VBA/Excel/Access/Word/Word/Word Document Print

Материал из VB Эксперт
Перейти к: навигация, поиск

print a document with all the default print settings

   <source lang="vb">

Sub main()

   Dim wdApp As Word.Application
   Set wdApp = GetObject(, "Word.Application")
   wdApp.ActiveDocument.PrintOut

End Sub

</source>
   
  


setting the Range and Pages arguments of the PrintOut method

   <source lang="vb">

Sub Main()

   Dim wdApp As Word.Application
   Set wdApp = GetObject(, "Word.Application")
   wdApp.ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Pages:="2"

End Sub

</source>