Search code examples
vbaexcelexcel-2010excel-2007

Inserting a Page Break in a Word Document Before a Bookmark using Excel VBA


How would you go about inserting a page break in a word document before a bookmark? I tried the following code but had no luck, if anyone has any ideas I'd love to hear them.

Set wRng = wdDoc.Bookmarks(FundCommentary).Range
    wRng.HomeKey wdLine, wdMove
    wRng.MoveUp wdLine, 1
    wRng.InsertBreak wdPageBreak

Solution

  • Set wRng = wdDoc.Bookmarks(FundCommentary).Range
    wRng.Collapse wdCollapseStart
    wRng.InsertBreak wdPageBreak