![]() |
|
|
|
#1
|
|||
|
|||
|
To catch headers, footers and other areas of a document you will need to loop through the storyranges. It is more complicated than the code below but this might work:
Code:
Sub Macro1()
Dim oRng As Range
For Each oRng In ActiveDocument.StoryRanges
With oRng.Find
.Font.Underline = wdUnderlineSingle
Do While .Execute
If Not oRng.Font.UnderlineColor = wdColorAutomatic Then
oRng.Font.Underline = wdUnderlineNone
End If
oRng.Collapse 0
Loop
End With
Set oRng = ActiveDocument.Range
With oRng.Find
.Font.Underline = wdUnderlineWords
Do While .Execute
If Not oRng.Font.UnderlineColor = wdColorAutomatic Then
oRng.Font.Underline = wdUnderlineNone
End If
oRng.Collapse 0
Loop
End With
Next oRng
lbl_Exit:
Exit Sub
End Sub
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Remove white text background (keeping the font color and page color intact
|
cc3125 | Word | 1 | 10-26-2015 06:44 PM |
VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color
|
jc491 | Word VBA | 8 | 09-30-2015 06:10 AM |
| Find instance of a word in a specific style and change its color | hwg | Word VBA | 7 | 02-20-2014 10:59 PM |
remove color from find/replace?
|
Cobb78 | Word | 1 | 05-26-2012 06:16 PM |
| How to remove the UNDERLINE from a hyperlink text? | Learner7 | PowerPoint | 3 | 05-17-2010 09:35 PM |