小册子打印代码


来源:高中英语教学交流
发布时间:2012-07-07 09:37:00
查看次数:

内容提要:最近发现,原来可以不用第三方软件可以实现小册子打印的效果,而且还很方便。以下提供代码,另外,会在下一个版本的ZSHUNJ工具箱中增加。

Sub 小册子打印()
'
' 宏在 2012-7-6 由 www.zshunj.cn录制
'
    Selection.Sections(1).Footers(1).PageNumbers.Add PageNumberAlignment:= _
        wdAlignPageNumberCenter, FirstPage:=True
    With ActiveDocument.Styles(wdStyleNormal).Font
        If .NameFarEast = .NameAscii Then
            .NameAscii = ""
        End If
        .NameFarEast = ""
    End With
    With ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .TopMargin = CentimetersToPoints(3.17)
        .BottomMargin = CentimetersToPoints(3.17)
        .LeftMargin = CentimetersToPoints(2.54)
        .RightMargin = CentimetersToPoints(2.54)
        .Gutter = CentimetersToPoints(0)
        .HeaderDistance = CentimetersToPoints(1.27)
        .FooterDistance = CentimetersToPoints(1.27)
        .PageWidth = CentimetersToPoints(27.94)
        .PageHeight = CentimetersToPoints(21.59)
        .FirstPageTray = wdPrinterDefaultBin
        .OtherPagesTray = wdPrinterDefaultBin
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = False
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = True
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = True
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
        .LayoutMode = wdLayoutModeDefault
    End With
End Sub


相关文章
·excel怎么生成随机数?02-03
·发送手机文件到电脑的方法11-01
·笔记本如何外接显示器08-13
·摆脱打印机显示打印机脱机困扰01-14
·Win10电脑开机启动慢?教你只需三步,电脑开机速度快到飞起!06-11
·Windows 7系统的硬盘安装方法05-13
·FinalData恢复在数码相机误删的相片08-07
·制作Word2003选择性粘贴快捷键07-09
·windows 2008 R2各版本激活180天05-03
·[亲测有效]excel批量修改文件名10-29
最新文章
阅读排行