Forward := True
只会将 myArray 中单词的颜色从光标位置更改到文件末尾。我想只应用于选定的句子。我没有找到命令。有什么建议么?提前致谢。
Dim rng As Word.range
Dim i As Long
Dim myArray
myArray = Array("FROM", "ADD", "MAYBE"......)
For i = 0 To UBound(myArray)
Set rng = Selection.range
With rng.Find
.Text = myArray(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute (Forward := True) = True
rng.Font.Color = RGB(100, 150, 255)
Loop
End With
Next
End Sub