View Single Post
 
Old 03-28-2023, 04:12 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote