View Single Post
 
Old 01-05-2016, 06:38 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

If you want to restrict the find to a particular font format, you need to specify those parameters. For example:
Code:
With oRng.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Text = rFindText
  With .Font
    .Bold = True
    .ColorIndex = wdTurquoise
    .Size = 16
  End With
  .Replacement.Text = ""
  .Forward = True
  .Wrap = wdFindStop
  .Format = True
  .MatchCase = True
  .MatchWholeWord = True
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Execute
  Do While .Found = True
    .FormattedText = rReplacement.FormattedText
    .Collapse wdCollapseEnd
    .Execute
  Loop
End With
The important part of the above for your purposes is the setting of the font attributes (there are other attributes you could also set, including italic, underline, etc.) and '.Format = True'. You may or may not want to match the case, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote