View Single Post
 
Old 07-30-2024, 02:24 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, Shelley Lou.
The problem is with the quot sign and tab to find which are bold. The following will do the job. Of course, there are other ways of doing this but they will be more complicated:
Code:
Sub Insert_Wd()

Dim oRng As range
Set oRng = selection.range
    oRng.Find.ClearFormatting
    oRng.Find.Replacement.ClearFormatting
    With oRng.Find
        .text = "(^34^9)\("
        .Replacement.text = "\1means("
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
        .Execute Replace:=wdReplaceAll
        .text = "means\("
        .Replacement.text = "^&"
        .Replacement.Font.Bold = False
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Reply With Quote