View Single Post
 
Old 08-16-2021, 11:58 PM
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 could probably replace using wildcards Replace using wildcards e.g.
Code:
Sub Macro1()
Dim oRng As Range
    Set oRng = ActiveDocument.Range
    With oRng.Find
        Do While .Execute(findText:="<[a-z]{3}[A-Z]{1}>", MatchWildcards:=True)
            oRng.Select
            If MsgBox("Replace?", vbYesNo) = vbYes Then
                oRng.Font.Italic = True
                oRng.Characters.Last.Font.Italic = False
            End If
            oRng.Collapse 0
        Loop
    End With
    Set oRng = 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