如何在页面末尾插入分页符

本文关键字:插入 分页 | 更新日期: 2023-09-27 18:24:28

我需要在第一页的末尾插入一个分页符。以下是所选内容。我正在尝试插入一个新页面,然后在该页面的末尾插入分页符。

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();

如何在页面末尾插入分页符

插入新页面后尝试添加以下内容:

oWord.Selection.InsertBreak(Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak);

可以通过以下方式将分页符添加到Word文档中:

string pageBreak = "'xC";  

或通过

string pageBreak= "'f";