printing from command line

  • Thread starter Thread starter A Inzerillo
  • Start date Start date
A

A Inzerillo

Is there a way to open a document, print it, and exit Word
from the command line? Or maybe there is another way, VB
perhaps, that I can print a number of Word documents
without opening up word manually.
 
The following vbscript will print a word document from
the command line.

-----------------
Dim WordApp, Doc
Set WordApp = CreateObject("Word.Application")
Set Doc = WordApp.documents.open("c:\test.doc")
Doc.PrintOut
WordApp.Quit
------------------

If the above script is named "printdoc.vbs", the
commandline will be:

cscript printdoc.vbs


This posting is provided "AS IS" with no warranties, and
confers no rights.

Si-Qing
 
Back
Top