VBA实现word页面设置 |
Sub AutoOpen() bqwz1n http://blog.numino.net/ Dim glkDoc As Document '定义变量 Ir2Hgv http://blog.numino.net/ Set glkDoc = Application.ActiveDocument '设置为当前文档 mFJ2F5 http://blog.numino.net/ With glkDoc '设置文档参数 2sCT02 http://blog.numino.net/ With .PageSetup '设置【页面设置】参数 OHqvFJ http://blog.numino.net/ .Orientation = wdOrientPortrait '页面方向:wdOrientPortrait--纵向,wdOrientLandscape--横向 wAyWwa http://blog.numino.net/ .PageWidth = CentimetersToPoints(21) '纸张宽21cm UWJEPd http://blog.numino.net/ .PageHeight = CentimetersToPoints(29.7) '纸张高29.7cm INmgvg http://blog.numino.net/ .TopMargin = CentimetersToPoints(2) '上边距2cm 1hQuA5 http://blog.numino.net/ .BottomMargin = CentimetersToPoints(1.5) '下边距1.5cm w915is http://blog.numino.net/ .LeftMargin = CentimetersToPoints(2.5) '左边距2.5cm bnxyVA http://blog.numino.net/ .RightMargin = CentimetersToPoints(1.5) '右边距1.5cm auc9d3 http://blog.numino.net/ .HeaderDistance = CentimetersToPoints(0.5) '页眉0.5cm 0KPR3I http://blog.numino.net/ .FooterDistance = CentimetersToPoints(0.5) '页脚0.5cm lG3VBZ http://blog.numino.net/ End With '结束【页面设置】参数设置 JrJXwU http://blog.numino.net/ .Save '保存文档参数 84hkD4 http://blog.numino.net/ End With '结束文档参数设置 wx2590 http://blog.numino.net/ End Sub
|
|