私のドキュメントでは、タイトルページがカウントされないように、[ページ番号の書式設定/開始:] を 0 に設定しています。
VBA 経由で名前を付けて保存すると、ドキュメントの設定が失われます。また、別の最初のページの設定が失われていたため、VBA で直接設定して、その問題を修正しました。SaveAs を実行する前に VBA 経由でフッターをフォーマットしているため、設定に何らかの影響を与えていると思いますか? とにかく、名前を付けて保存した後に開始ページ番号を設定しようとしましたが、設定されません。
' Save our new Workbook - the output file
' That makes the new file the ActiveDocument
ActiveDocument.SaveAs filename:=fname & ".docx", FileFormat:= _
wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
' Sets this option correctly
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True
' Problem: Doesnt set this option
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).PageNumbers.StartingNumber = 0
' Update the TOC
ActiveDocument.TablesOfContents(1).Update
何か案は?
ありがとう、マレー