View Single Post
 
Old 01-14-2022, 03:43 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You don't need the loop
Code:
Sub NonBreakSpace()
Const strFR As String = "<(et)> <(al)>|\1^s\2"
Dim i As Long
    Options.DefaultHighlightColorIndex = wdTurquoise
    With ActiveDocument.Range.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Replacement.Highlight = True
        .Text = strFR
        .Forward = True
        .Wrap = wdFindStop
        .MatchWildcards = True
        .Text = Split(strFR, "|")(0)
        .Replacement.Text = Split(strFR, "|")(1)
        .Execute Replace:=wdReplaceAll
    End With
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote