国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 辦公 > Word > 正文

Word Vba修改頁邊距、紙張縱向、裝定線等的代碼

2024-08-22 13:26:47
字體:
來源:轉載
供稿:網友

  下面的WAPP是事先定義的word文檔工程變量。

  以下代碼為通過VBA代碼來頁面的頁邊距、紙張縱向、裝定線、頁眉頁靜等。

  WApp.ActiveDocument.PageSetup.LineNumbering.Active =0;//行編號

  WApp.ActiveDocument.PageSetup.Orientation =Microsoft.Office.Interop.Word.WdOrientation.wdOrientPortrait;//頁面方向

  WApp.ActiveDocument.PageSetup.TopMargin =WApp.CentimetersToPoints(float.Parse("2.54"));//上頁邊距

  WApp.ActiveDocument.PageSetup.BottomMargin = WApp.CentimetersToPoints(float.Parse("2.54"));//下頁邊距

  WApp.ActiveDocument.PageSetup.LeftMargin = WApp.CentimetersToPoints(float.Parse("3.17"));//左頁邊距

  WApp.ActiveDocument.PageSetup.RightMargin = WApp.CentimetersToPoints(float.Parse("3.17"));//右頁邊距

  WApp.ActiveDocument.PageSetup.Gutter = WApp.CentimetersToPoints(float.Parse("0"));//裝訂線位置

  WApp.ActiveDocument.PageSetup.HeaderDistance = WApp.CentimetersToPoints(float.Parse("1.5"));//頁眉

  WApp.ActiveDocument.PageSetup.FooterDistance = WApp.CentimetersToPoints(float.Parse("1.75"));//頁腳

  WApp.ActiveDocument.PageSetup.PageWidth = WApp.CentimetersToPoints(float.Parse("21"));//紙張寬度

  WApp.ActiveDocument.PageSetup.PageHeight = WApp.CentimetersToPoints(float.Parse("29.7"));//紙張高度

  WApp.ActiveDocument.PageSetup.FirstPageTray = Microsoft.Office.Interop.Word.WdPaperTray.wdPrinterDefaultBin;//紙張來源

  WApp.ActiveDocument.PageSetup.OtherPagesTray = Microsoft.Office.Interop.Word.WdPaperTray.wdPrinterDefaultBin;//紙張來源

  WApp.ActiveDocument.PageSetup.SectionStart = Microsoft.Office.Interop.Word.WdSectionStart.wdSectionNewPage;//節的起始位置:新建頁

  WApp.ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter = 0;//頁眉頁腳-奇偶頁不同

  WApp.ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = 0;//頁眉頁腳-首頁不同

  WApp.ActiveDocument.PageSetup.VerticalAlignment = Microsoft.Office.Interop.Word.WdVerticalAlignment.wdAlignVerticalTop;//頁面垂直對齊方式

  WApp.ActiveDocument.PageSetup.SuppressEndnotes =0;//不隱藏尾注

  WApp.ActiveDocument.PageSetup.MirrorMargins = 0;//不設置首頁的內外邊距

  WApp.ActiveDocument.PageSetup.TwoPagesOnOne = false;//不雙面打印

  WApp.ActiveDocument.PageSetup.BookFoldPrinting =false;//不設置手動雙面正面打印

  WApp.ActiveDocument.PageSetup.BookFoldRevPrinting =false;//不設置手動雙面背面打印

  WApp.ActiveDocument.PageSetup.BookFoldPrintingSheets = 1;//打印默認份數

  WApp.ActiveDocument.PageSetup.GutterPos = Microsoft.Office.Interop.Word.WdGutterStyle.wdGutterPosLeft;//裝訂線位于左側

  WApp.ActiveDocument.PageSetup.LinesPage = 40;//默認頁行數量

  WApp.ActiveDocument.PageSetup.LayoutMode = Microsoft.Office.Interop.Word.WdLayoutMode.wdLayoutModeLineGrid;//版式模式為“只指定行網格”

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 论坛| 铜鼓县| 渭源县| 克拉玛依市| 屏山县| 宁明县| 桓仁| 平江县| 凉山| 贵州省| 高台县| 桦川县| 宁波市| 周至县| 岚皋县| 铜鼓县| 聂拉木县| 敦煌市| 石首市| 托克托县| 汽车| 云安县| 奎屯市| 平和县| 南安市| 武安市| 高雄市| 杭锦后旗| 慈利县| 东阿县| 襄城县| 卓尼县| 泰州市| 启东市| 乌拉特中旗| 大埔县| 河间市| 揭东县| 玉溪市| 疏附县| 抚宁县|