国产探花免费观看_亚洲丰满少妇自慰呻吟_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;//版式模式為“只指定行網格”

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 孝义市| 邳州市| 元谋县| 阿拉尔市| 清水河县| 龙海市| 芮城县| 台中市| 全州县| 丰县| 枞阳县| 禄劝| 时尚| 高雄市| 阿克陶县| 金川县| 凤城市| 潞城市| 万全县| 井陉县| 会理县| 阳西县| 托里县| 云和县| 东源县| 宜兰市| 陈巴尔虎旗| 上饶市| 陇南市| 大化| 灵寿县| 蓝田县| 称多县| 拉孜县| 黄陵县| 五台县| 洮南市| 昭通市| 静海县| 武邑县| 镇原县|