我正在尋找Word中的VBA代碼以突出顯示引號外有句號的任何句子。即在文本「你好詞」中。我想要「,並在運行宏時突出顯示。VBA代碼來查找並突出顯示字符組合
@il_raffa ..我有一個代碼,可以突出顯示我不想在信中看到的單詞。不知道如何合併符號在裏面。
Sub HighlightTargets2()
Dim range As range
Dim i As Long
Dim TargetList
TargetList = Array("I", "We", "our", "discusses about", "we", "asserts")
For i = 0 To UBound(TargetList)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdYellow
Loop
End With
Next
End Sub
你做過任何嘗試嗎? –
@il_raffa ..我有我的代碼來突出顯示我不想在信中看到的單詞。這裏是: – Ishwarya