View Single Post
 
Old 05-08-2021, 04:01 PM
jeffreybrown jeffreybrown is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2016
Posts: 673
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Figured it out with two macro. Since one of these macros uses FNR and the other does not, can they be combined or should they just stay separate?

Code:
Sub Replace_Me()
    With ActiveDocument.Range.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Replacement.Style = ActiveDocument.Styles("Book Title")
        .Text = "^13MESSAGE NOTES[!^13]@^13"
        .Replacement.Text = "^&"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = True
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
    End With
End Sub
Code:
Sub Macro5()
    With ActiveDocument.Range.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "DETAILED NOTES John"
        .Replacement.Text = "MESSAGE NOTES ^+ Luke"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .Execute Replace:=wdReplaceAll
    End With
End Sub

Last edited by jeffreybrown; 05-08-2021 at 07:36 PM.
Reply With Quote