Change this section of your original code:
Code:
For i = LBound(myarray) To UBound(myarray)
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:=myarray(i, 1), Forward:=True, _
MatchWildcards:=True, Wrap:=wdFindStop, MatchCase:=False) = True
Set rng = Selection.Range
Selection.Collapse wdCollapseEnd
rng.Font.Italic = True
rng.Font.Bold = True
rng.Font.Color = RGB(200,187,0)
rng.Font.Name ="Times New Roman"
rng.Case= wdTitleSentence 'wdUpperCase works; this doesn't; something else I could put here?
Loop
Next i
to:
Code:
Dim oRng As Range Dim strFind As String
For i = LBound(myarray) To UBound(myarray)
strFind = myarray(i)
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = strFind
.Forward = True
.Wrap = wdFindStop
.MatchCase = False
While .Execute
oRng.Font.Italic = True
oRng.Font.Bold = True
oRng.Font.Color = RGB(200, 187, 0)
oRng.Font.Name = "Times New Roman"
oRng.Case = wdLowerCase
oRng.Words(1).Characters(1).Case = wdUpperCase
oRng.Collapse wdCollapseEnd
Wend
End With
Next i
or the other variation I suggested.