Word VBA打印整个文档

时间:2014-01-10 22:53:45

标签: printing ms-word word-vba

目前Sub CurrentpageP()仅打印文档的第一页。

无法弄清楚如何打印整个文档。我已将页面参数更改为以下但没有运气“1-9999”和“1-2”。

对于长代码,

Link here - 以下是该部分的代码段。

Sub CurrentpageP()
With ActiveDocument.PageSetup
    .FirstPageTray = 281
    .OtherPagesTray = 281
End With
Application.PrintOut FileName:="", Range:=wdPrintCurrentPage, Item:= _
    wdPrintDocumentContent, Copies:=1, pages:="", PageType:=wdPrintAllPages, _
    Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
    PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

End Sub

1 个答案:

答案 0 :(得分:1)

当您将范围设置为“ wdPrintCurrentPage ”时,您告诉Word只打印当前页面。如果要打印整个文档,则需要将范围设置为“ wdPrintAllDocument ”。范围类型列在这里: http://msdn.microsoft.com/en-us/library/office/bb237956(v=office.12).aspx