View Single Post
 
Old 05-04-2020, 03:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

There is no such property as:
.Font.HighlightColorIndex = wdBlack
Moreover, you can't set the HighlightColorIndex that way via Find/Replace. You need to use something like:
Code:
Options.DefaultHighlightColorIndex = wdBlack
With ActiveDocument.Content.Find
  .ClearFormatting
  .Font.Shading.BackgroundPatternColor = RGB(235, 214, 214)
  With .Replacement
    .ClearFormatting
    .Font.Bold = True
    .Font.ColorIndex = wdWhite
    .Font.Shading.BackgroundPatternColor = RGB(0, 0, 0)
    .Highlight = True
  End With
  .Execute FindText:="", ReplaceWith:="", Format:=True, Replace:=wdReplaceAll
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote