我正在尝试为 word 编写一个 vba 宏,其中文档将具有页码,但奇数页码的对齐方式将与偶数页不同。我目前正在尝试的代码正在更改奇数页和偶数页的对齐方式,这是不需要的
ActiveDocument.Sections(i).PageSetup.OddAndEvenPagesHeaderFooter = False
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.LinkToPrevious = Not Selection.HeaderFooter.LinkToPrevious
ActiveDocument.Sections(i).Footers(wdHeaderFooterPrimary).LinkToPrevious = False
With ActiveDocument.Sections(i).Footers(1).PageNumbers
.NumberStyle = wdPageNumberStyleArabic
.HeadingLevelForChapter = 0
.IncludeChapterNumber = False
.ChapterPageSeparator = wdSeparatorHyphen
.RestartNumberingAtSection = False
.StartingNumber = starts
.Add (0)
End With
End If
ActiveDocument.Sections(i).PageSetup.OddAndEvenPagesHeaderFooter = True
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
ActiveDocument.Sections(i).Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
WordBasic.InsertAlignmentTab Alignment:=2, Relative:=0, Leader:=0