我有以下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()
答案 0 :(得分:1)
你可以尝试:
'wdAlignPageNumberCenter=1
wordDoc.Sections(1).Footers(1).PageNumbers.Add (1)