VBA-添加打印页面设置

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Sub Add_Print_Info()
'Add print information
'Header-->Path+File
'Footer-->Page+Total_Page;Date+Time
'
    'Application.PrintCommunication = False
    With ActiveSheet.PageSetup         '设置页面
        .LeftHeader = "&Z &F"          '页眉左:增加文件地址
        .CenterHeader = ""             '页眉中:
        .RightHeader = ""              '页眉右:
        .LeftFooter = "&P/&N"          '页脚左:页数/总页数
        .CenterFooter = ""             '页脚中:
        .RightFooter = "&D &T"         '页脚右:日期/时间
        .PaperSize = xlPaperA4         '纸张:A4
        .BlackAndWhite = True          '黑白打印
        .Zoom = False
        .FitToPagesWide = 1            '适应为1页
        .FitToPagesTall = 1            '适应为1页
    End With
    'Application.PrintCommunication = True
End Sub

 

转载于:https://my.oschina.net/tedzheng/blog/798186

你可能感兴趣的:(VBA-添加打印页面设置)