A
andreas
Dear Experts:
below macro is supposed to hightlight all occurrences (words/
characters) that feature the Arial font.
Somehow the macro skips whole paragraphs and does not higlight all
occurrences of Arial font formatting in my document. How come?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub HighlightFontArial()
Dim rng As range
Set rng = ActiveDocument.StoryRanges(wdMainTextStory)
With rng.Find
.ClearFormatting
.Font.Name = "Arial"
.Forward = True
.Wrap = wdFindStop
End With
Do While rng.Find.Execute
rng.HighlightColorIndex = wdYellow
Loop
End Sub
below macro is supposed to hightlight all occurrences (words/
characters) that feature the Arial font.
Somehow the macro skips whole paragraphs and does not higlight all
occurrences of Arial font formatting in my document. How come?
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
Sub HighlightFontArial()
Dim rng As range
Set rng = ActiveDocument.StoryRanges(wdMainTextStory)
With rng.Find
.ClearFormatting
.Font.Name = "Arial"
.Forward = True
.Wrap = wdFindStop
End With
Do While rng.Find.Execute
rng.HighlightColorIndex = wdYellow
Loop
End Sub