-
After having spent some time, it's clear that I'm not yet apt to resolve the problem. So, I devised a simple ("lame") workaround that still helps:
::Please don't laugh::
[VBA]Sub ScratchMacro()
Dim oRng As Word.Range
Dim arrWords
Dim i As Long
arrWords = Array("I think that", "very")
For i = 0 To UBound(arrWords)
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = arrWords(i)
.MatchWholeWord = True
.Replacement.Highlight = True
.Execute Replace:=wdReplaceAll
End With
Next
arrWords = Array("the", "list", "of", "words", "to", "exclude")
For i = 0 To UBound(arrWords)
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = arrWords(i)
.MatchWholeWord = False
.Replacement.Highlight = False
.Execute Replace:=wdReplaceAll
End With
Next
End Sub [/VBA]Only thing's that the highlight color stays uniform throughout.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules