none
page break macro RRS feed

  • Question

  • How do create a macro to replace text ie <<page break>> with a page break in a word document?
    Thursday, March 17, 2011 3:21 PM

Answers

  • That's perfect thank you!
    • Marked as answer by Tessa75 Thursday, March 17, 2011 4:27 PM
    • Unmarked as answer by Tessa75 Thursday, March 17, 2011 4:57 PM
    • Marked as answer by Tessa75 Thursday, March 17, 2011 4:59 PM
    Thursday, March 17, 2011 4:26 PM

All replies

  • Try this:

    Sub SetPageBreaks()
        Selection.HomeKey Unit:=wdStory
        With Selection.Find
            .ClearFormatting
            .Replacement.ClearFormatting
            .Text = "<<page break>>"
            .Replacement.Text = "^m"
            .Execute Replace:=wdReplaceAll
        End With
    End Sub


    Regards, Hans Vogelaar
    Thursday, March 17, 2011 3:53 PM
  • That's perfect thank you!
    • Marked as answer by Tessa75 Thursday, March 17, 2011 4:27 PM
    • Unmarked as answer by Tessa75 Thursday, March 17, 2011 4:57 PM
    • Marked as answer by Tessa75 Thursday, March 17, 2011 4:59 PM
    Thursday, March 17, 2011 4:26 PM