1

我有以下 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 Page Content."
para.Range.InsertParagraphAfter()

para.Range.InsertBreak()

para.Range.Text = "Second Page Content."
para.Range.InsertParagraphAfter()
4

1 回答 1

1

你可以试试:

 'wdAlignPageNumberCenter=1
 wordDoc.Sections(1).Footers(1).PageNumbers.Add (1)
于 2012-09-12T16:21:33.590 回答