Hi to all!
I made a program in MS Word that highlights certain words. Some of them are highlighted in [highlight lightgreen]"Green"[/highlight], other in [highlight yellow]"Yellow"[/highlight], some in [highlight #FF99FF]"Pink"[/highlight] etc.
Now I would like to automatically find all words that are highlighted - let's say - in [highlight yellow]"Yellow"[/highlight] and remove highlight.
I recorded a macro to see the syntax and I got:
The problem is that MS Word doesn't offer what kind of a highlight color would I like to find -> see second row above. It finds all highlighted words regardless to their color.
Can anyone help me how to include "wdYellow" for ColorIndex in my code?
I made a program in MS Word that highlights certain words. Some of them are highlighted in [highlight lightgreen]"Green"[/highlight], other in [highlight yellow]"Yellow"[/highlight], some in [highlight #FF99FF]"Pink"[/highlight] etc.
Now I would like to automatically find all words that are highlighted - let's say - in [highlight yellow]"Yellow"[/highlight] and remove highlight.
I recorded a macro to see the syntax and I got:
Code:
Selection.Find.ClearFormatting
Selection.Find.Highlight = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
The problem is that MS Word doesn't offer what kind of a highlight color would I like to find -> see second row above. It finds all highlighted words regardless to their color.
Can anyone help me how to include "wdYellow" for ColorIndex in my code?