Jack Henderson
Jack Henderson

Reputation: 93

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

Upvotes: 0

Views: 1373

Answers (1)

Tim Williams
Tim Williams

Reputation: 166241

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

Upvotes: 3

Related Questions