View Single Post
 
Old 08-01-2020, 09:51 AM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,427
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

It isn't a bug. You are explicitly ignoring the first instance found.


Code:
Sub ClearSpecificHighlight()
Dim oRngStory As Range
  For Each oRngStory In ActiveDocument.StoryRanges
    Do
      With oRngStory.Find
        .Highlight = True
        Do While .Execute
          If oRngStory.HighlightColorIndex = wdTurquoise Then
             oRngStory.HighlightColorIndex = wdNoHighlight
             oRngStory.Collapse 0
          End If
        Loop
      End With
      'Get next linked story (if any)
      Set oRngStory = oRngStory.NextStoryRange
    Loop Until oRngStory Is Nothing
  Next
lbl_exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote