使用Microsoft.Office.Interop.Word时强制在新页面上使用段落

时间:2012-09-11 12:44:16

标签: vb.net interop ms-word

我有以下VB.Net代码来创建Microsoft Word文档。我怎么能强迫“第二段”。在下一页(新页面)?

Imports Word = Microsoft.Office.Interop.Word

Dim wordApp As Word._Application = New  _
    Word.ApplicationClass()

    Dim wordDoc As Word._Document = _
        wordApp.Documents.Add()

    Dim para As Word.Paragraph = wordDoc.Paragraphs.Add()
    para.Range.Text = "First Paragraph."
    para.Range.InsertParagraphAfter()

    para.Range.Text = "Second Paragraph."
    para.Range.InsertParagraphAfter()

1 个答案:

答案 0 :(得分:2)

您可以使用InsertBreak开始新页面:

  Selection.InsertBreak

WdBreakType Enumeration