D
dsc
Best I can figure, the following code ought to search my document for the
terms in SearchArray and turn them green. However, it also turns other
sections of text green, apparently at random. Can anybody tell me why that
might be?
Thanks in advance.
For i = 0 To UBound(SearchArray)
TermString = SearchArray(i, 0)
StandardString = SearchArray(i, 1)
'Insert all English entries for this client
With ActiveDocument.Content.Find
.Font.Color = wdColorBlack
.Text = TermString
.Replacement.Font.Color = wdColorGreen
.Replacement.Text = TermString
.Forward = True
.wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchByte = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
.Execute Replace:=wdReplaceAll
End With
Next
terms in SearchArray and turn them green. However, it also turns other
sections of text green, apparently at random. Can anybody tell me why that
might be?
Thanks in advance.
For i = 0 To UBound(SearchArray)
TermString = SearchArray(i, 0)
StandardString = SearchArray(i, 1)
'Insert all English entries for this client
With ActiveDocument.Content.Find
.Font.Color = wdColorBlack
.Text = TermString
.Replacement.Font.Color = wdColorGreen
.Replacement.Text = TermString
.Forward = True
.wrap = wdFindContinue
.Format = True
.MatchCase = True
.MatchWholeWord = True
.MatchByte = True
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
.Execute Replace:=wdReplaceAll
End With
Next