![]() |
#2
|
|||
|
|||
![]()
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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
eduzs | Word VBA | 9 | 07-27-2020 07:43 AM |
VBA to highlight specific values in the spreadsheet | daiwuliz | Excel | 6 | 05-23-2018 10:30 AM |
![]() |
cc3125 | Word | 1 | 10-26-2015 06:44 PM |
Change highlight color | maceslin | Word | 3 | 04-30-2013 04:43 AM |
![]() |
Redbarn | Word VBA | 1 | 03-16-2013 02:03 PM |