Look through each of the vFindText in the code and add your word that you want highlighted. I see TWO vFindText CODES. One is Red and the other is blue, if you need additional colors. Then you can copy the start of code and the end of code and change to the next color. See below:
'highlight yellow words
Options.DefaultHighlightColorIndex = wdYellow
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
vFindText = Array("Teacher", "Students", "Grades")
vReplText = "^&"
With Selection.Find
.Forward = True
.Wrap = wdFindContinue
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Format = True
.MatchCase = False
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText
.Replacement.Highlight = True
.Execute replace:=wdReplaceAll
Next i
End With
Then copy and paste additional colors into the code below: Make sure you change
From this:
'highlight yellow words
Options.DefaultHighlightColorIndex = wdYellow
To this
'highlight green words
Options.DefaultHighlightColorIndex = wdGreen
and add
vFindText = Array("Next word", "Next word", "Next word")
|