View Single Post
 
Old 05-30-2022, 06:08 AM
stky stky is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Apr 2021
Posts: 30
stky is on a distinguished road
Default 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
Reply With Quote