1

I need to insert a page break at the end of the first page. Below is the selection. I am trying to insert a new page, then insert the page break at the end of that page.

object what = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToPage;
object which = Microsoft.Office.Interop.Word.WdGoToDirection.wdGoToAbsolute;
object count = 1; //change this number to specify the start of a different page

oWord.Selection.GoTo(ref what, ref which, ref count, ref oMissing);

oWord.Selection.InsertNewPage();
Deduplicator
  • 44,692
  • 7
  • 66
  • 118
sharpiee
  • 55
  • 4
  • 11

2 Answers2

4

Try adding the following after inserting the new page:

oWord.Selection.InsertBreak(Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak);
Grant Winney
  • 65,241
  • 13
  • 115
  • 165
1

A page break can be added to a Word document in the following way:

string pageBreak = "\xC";  

or by

string pageBreak= "\f";
user3165438
  • 2,631
  • 7
  • 34
  • 54