Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2014, 01:15 PM
gmaxey gmaxey is offline Creating a list of all text in a specific style Windows 7 32bit Creating a list of all text in a specific style Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default


What kind of style? Here is one way to list all text with the "Strong" character style applied:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
  With oRng.Find
    .Style = "Strong"
    While .Execute
      ActiveDocument.Range.InsertAfter vbCr & oRng
      ActiveDocument.Paragraphs.Last.Range.Style = "Normal"
      oRng.Collapse wdCollapseEnd
    Wend
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #2  
Old 10-08-2014, 03:29 PM
ljd108 ljd108 is offline Creating a list of all text in a specific style Windows Vista Creating a list of all text in a specific style Office 2010 32bit
Novice
Creating a list of all text in a specific style
 
Join Date: Oct 2014
Posts: 24
ljd108 is on a distinguished road
Default Error message?

Hi,

The style I am using is my own custom style and it is called "Glossary Pop-up" would that cause an issue at all? When I run the macro nothing happens?

Thanks
Reply With Quote
Reply

Tags
macro, styles

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a list of all text in a specific style How to set the left indent in a specific style. OfficeBoy95 Word 2 05-12-2014 06:31 PM
Creating a list of all text in a specific style List Style Numbering picks up out of order number from LATER list spthomas Word 12 12-16-2013 05:23 PM
How to set style automatically for specific texts ragesz Word 2 07-25-2013 07:08 AM
Creating a list of all text in a specific style I create a new style but it fails to appear in Quick Style list veronius Word 6 06-18-2013 06:29 PM
Get list of text of a style mavera2 Word 0 03-19-2010 01:59 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft