View Single Post
 
Old 10-14-2022, 08:46 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,138
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

Selection.Paragraphs(1) will work. There is no need to select the paragraph. You do however have to stop the search when the range has been processed.



Code:
Sub TestV3()
'
'
Dim Rng As Range
    Set Rng = Selection.Paragraphs(1).Range
    With Rng.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "[no?ooo~uo]"
        .Replacement.Text = ""
        .Wrap = wdFindStop 'stop the search
        .Format = True
        .Execute Replace:=wdReplaceAll
    End With
    Set Rng = Nothing
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