Sub 設置頁面(oDoc As Document) With oDoc.PageSetup .LineNumbering.Active = False .Orientation = wdOrientPortrait '頁面方向為縱向 .TopMargin = CentimetersToPoints(3.3) '上邊距 .BottomMargin = CentimetersToPoints(3.3) '下邊距 .LeftMargin = CentimetersToPoints(2.8) '左邊距 .RightMargin = CentimetersToPoints(2.6) '右邊距 .Gutter = CentimetersToPoints(0) '裝訂線 .HeaderDistance = CentimetersToPoints(1.5) '頁眉 .FooterDistance = CentimetersToPoints(1.75) '頁腳 .PageWidth = CentimetersToPoints(21) '紙張寬 .PageHeight = CentimetersToPoints(29.7) '紙張高 .FirstPageTray = wdPrinterDefaultBin .OtherPagesTray = wdPrinterDefaultBin .SectionStart = wdSectionNewPage '節的起始位置:新建頁 .OddAndEvenPagesHeaderFooter = False '不勾選“奇偶頁不同” .DifferentFirstPageHeaderFooter = False '不勾選“首頁不同” .VerticalAlignment = wdAlignVerticalTop '頁面垂直對齊方式為“頂端對齊” .SuppressEndnotes = False '不隱藏尾注 .MirrorMargins = False '不設置首頁的內外邊距 .TwoPagesOnOne = False .BookFoldPrinting = False .BookFoldRevPrinting = False '不設置手動雙面打印 .BookFoldPrintingSheets = 1 '默認打印份數為1 .GutterPos = wdGutterPosLeft '裝訂線位於左側 .LayoutMode = wdLayoutModeLineGrid '版式模式為“只指定行網格” End With End Sub
--2020/4/24/更新--
增加參數,方便調用,不僅針對當前文檔設置。
