View Single Post
 
Old 03-28-2023, 06:23 PM
syl3786 syl3786 is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Jan 2023
Posts: 97
syl3786 is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
You can use Select Case to act on multiple options at the same time. For example if you want to treat turquoise, pink AND mixed in the same way...
Code:
Sub ClearHilites()
  Dim oRngStory As Range
  For Each oRngStory In ActiveDocument.StoryRanges
    With oRngStory.Find
      .Highlight = True
      Do While .Execute
        Select Case oRngStory.HighlightColorIndex
          Case wdTurquoise, wdPink, 9999999
           oRngStory.HighlightColorIndex = wdNoHighlight
           oRngStory.Collapse 0
        End Select
      Loop
    End With
  Next
End Sub
You expanded my horizons! Thank you so much for your help! It runs well!
Reply With Quote