View Single Post
 
Old 02-22-2025, 02:49 PM
nonno nonno is offline Windows 11 Office 2021
Novice
 
Join Date: Mar 2023
Posts: 13
nonno is on a distinguished road
Default

As I mentioned, I'm going to incorporate this with other macros, so it would be nice to do this with a macro as well.

I recorded a macro and updated it to get this, but it skips the very first paragraph of the Word document.

Code:
Sub Macro9()
    
    Selection.HomeKey Unit:=wdStory, Extend:=wdMove
    
    With Selection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Text = "^p"
        .Replacement.Text = "^p ^= "
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Reply With Quote