Jump to Real's How-to Main page

Print a document

[printdoc.vbs]

' Word need to be installed on this machine
Dim DocToPrint, oWord, oDoc
DocToPrint = "C:\MyFile.Doc"
Set oWord = CreateObject("Word.Application")
Set oWordActiveDoc = oWord.Documents.Open("" & DocToPrint)
oWordActiveDoc.PrintOut

Set oWord = Nothing
WScript.Quit(0)

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]