View Single Post
 
Old 03-30-2020, 07:00 AM
Jage Jage is offline Mac OS X Office 2016 for Mac
Novice
 
Join Date: Mar 2020
Posts: 2
Jage is on a distinguished road
Default Trouble highlighting all instances of superscript text

Hi everyone.

My apologies for the newbie question. I would like to highlight all instances of superscript text in a Word document. I have got as far as the following code but it doesn't seem to be working. Does anyone have any tips on what I am missing here?

Many thanks!

Code:
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    Selection.Find.Replacement.Highlight = True
    Options.DefaultHighlightColorIndex = wdYellow
    Selection.Range.HighlightColorIndex = wdYellow
    With Selection.Find
      .Font.Superscript = True
      .Replacement.Text = "^&"
      .Forward = True
      .Wrap = wdFindContinue
      .Format = True
      .MatchCase = False
      .MatchWholeWord = False
      .MatchWildcards = False
      .MatchSoundsLike = False
      .MatchAllWordForms = False
  End With
  Selection.Find.Execute Replace:=wdReplaceAll
Reply With Quote