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

Without seeing the document, the following should do that. It searches for manual page breaks and adds the built-in Title paragraph style to the line following the page break. You can format that style however you wish:
Code:
Sub Macro1()
Dim orng As Range
    Set orng = ActiveDocument.Range
    orng.Paragraphs(1).Range.Style = "Title"
    With orng.Find
        Do While .Execute(findText:="^m")
            orng.Collapse 0
            orng.Next.Paragraphs(1).Style = "Title"
        Loop
    End With
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