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

首頁 > 辦公 > Word > 正文

word修改頁邊距/紙張縱向/裝定線等vba代碼

2024-08-22 13:39:48
字體:
來源:轉載
供稿:網友
下面的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;//版式模式為“只指定行網格”
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阳新县| 武夷山市| 龙泉市| 崇阳县| 咸阳市| 镇坪县| 高陵县| 咸宁市| 嘉荫县| 基隆市| 黄冈市| 黔西| 盘锦市| 贵港市| 琼海市| 当雄县| 大悟县| 兴化市| 肥乡县| 青铜峡市| 习水县| 崇左市| 治县。| 奉新县| 辉南县| 科尔| 连江县| 长海县| 安宁市| 招远市| 阆中市| 土默特左旗| 吉木萨尔县| 岳阳县| 武平县| 晋江市| 垦利县| 双牌县| 弥渡县| 正镶白旗| 石嘴山市|