VBA操作WORD(三):设置页面

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

 

  • 0
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值