![]() |
|
#1
|
||||
|
||||
|
Hi friends!
Is there a way that i can automatically scan my doc and extract all the text formatted with a certain char style and put that text at the end of the document? I know a macro could do this, but I don't know how to write macros :-( Thank You Susan |
|
#2
|
||||
|
||||
|
That should be simple enough. Try the following
Installing Macros Code:
Sub Macro1()
Const sName As String = "Strong" ' the name of the character style
Dim orng As Range
Set orng = ActiveDocument.Range
With orng.Find
.Style = sName
.Text = ""
Do While .Execute
ActiveDocument.Range.InsertAfter orng.Text & vbCr
Loop
End With
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#3
|
||||
|
||||
|
Works perfectly. Thank You So much!!
Susan |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Collecting data from a moving field. (I think) | dobbin004 | Excel | 1 | 01-02-2018 01:03 AM |
Macro to search warning text style and replace the text color
|
rohanrohith | Word VBA | 3 | 11-27-2014 01:08 PM |
| Matching text style to drawing object style | notarichman | PowerPoint | 0 | 03-07-2011 11:34 AM |
| Collecting Metrics in Project | TimJimO | Project | 0 | 12-29-2010 12:12 PM |
| Need to delete style and style text | mclan | Word | 0 | 08-04-2008 12:05 PM |