Thanks Macropod
I think got now.
Sub Test()
Dim i As Long, NameOrig As Variant
MyList = Array("—", "[ ]{1,}—", "—[ ]{1,}", "[ ]{1,}—[ ]{1,}")
Options.DefaultHighlightColorIndex = wdTurquoise
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Replacement.Text = "^32—^32"
For i = 0 To UBound(MyList)
.Text = MyList(i)
.Replacement.Highlight = wdTurquoise
.Execute Replace:=wdReplaceAll
Next
End With
End Sub
|