View Single Post
 
Old 03-25-2020, 08:19 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

After:
i As Long
insert:
, Hlite As Long
on the same line.

After:
strFile = Dir(strFolder & "\*.doc", vbNormal)
insert new lines with:
'Set the preferred highlight colour
Hlite = Options.DefaultHighlightColorIndex
Options.DefaultHighlightColorIndex = wdBrightGreen

After:
.Replacement.ClearFormatting
insert new lines with:
.Replacement.Highlight = True
.Format = True

After:
Set wdDoc = Nothing
insert new lines with:
'Restore the original highlight setting
Options.DefaultHighlightColorIndex = Hlite
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote