How to print a document from a script 
Author Message
 How to print a document from a script

I want to write a script to read a directory and print all its contents to
the current printer, anyone know how to tell a document to print?  In
particular I will be printing pdf documents.
Thanks
dennis


Sat, 21 Sep 2002 03:00:00 GMT  
 How to print a document from a script
Check C. Washingtons site. There are a few solutions demonstrating
to print a directory listing. if you like to print a document file itself,
things are getting a bit strange.

- A text file may be printed using Notepad (Use run to shell out something
   like  oWShell.Run "Notepad.exe /p" & your_path_and_file, 1, true

- A HTML file can be printed using MSHTML.DLL, like something:
 oWSHShell.Run "Rundll32.exe MSHTML.dll,PrintHTML " & _
                 WScript.ScriptFullName, 7, true

- or you can use the oIE.ExecWB 6, -1 method from IE.

- printing a DOC, XLS file may be done using Word or Excel either

- printing PDFs may be done using Adobe Acrobat ActiveX control.

See newsletter #5 in my WSH Bazaar, that deals extensively how to
print PDFs. Samples for automation from Office with WSH are also in
the WSH Bazaar.

Actually is no easy way to print any registered document file in WSH.
But I wrote an ActiveX that provides a method to print any registered
document type (even bmp, gif, tiff, pdf and so on). If you are interested,
I can send you the ocx for test purposes.

G. Born

Check out the WSH Bazaar at:

www.borncity.de

Dennis O'Neill schrieb in Nachricht ...

Quote:
>I want to write a script to read a directory and print all its contents to
>the current printer, anyone know how to tell a document to print?  In
>particular I will be printing pdf documents.
>Thanks
>dennis



Sun, 22 Sep 2002 03:00:00 GMT  
 How to print a document from a script
You can also look at the "script.application" object. It has a namespace
method that returns a folder and item for which you can inspect all the
verbs. You can execute the Print verb which will let the shell do the rest.
It's all documented in msdn.


Quote:
> I want to write a script to read a directory and print all its contents to
> the current printer, anyone know how to tell a document to print?  In
> particular I will be printing pdf documents.
> Thanks
> dennis



Sun, 22 Sep 2002 03:00:00 GMT  
 How to print a document from a script
"script.application" object

I assume you meant the "Shell.Application" object.

--
Michael Harris
MVP Scripting


You can also look at the "script.application" object. It has a namespace
method that returns a folder and item for which you can inspect all the
verbs. You can execute the Print verb which will let the shell do the rest.
It's all documented in msdn.


Quote:
> I want to write a script to read a directory and print all its contents to
> the current printer, anyone know how to tell a document to print?  In
> particular I will be printing pdf documents.
> Thanks
> dennis



Sun, 22 Sep 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Print document using Client/Server script !

2. Printing Downloaded documents using client side script

3. Print document using Client/Server script !

4. printing a changed document.body without changing the existing document.body

5. Add new script to window.document.scripts

6. Add new script to window.document.scripts

7. IE5 Printing - Office Documents

8. Printing word documents

9. Printing Macintosh documents on an Apollo printer

10. Problems with Printing content created by Document.Write

11. Printing documents b/w with embeded bitmaps

12. Printing ISO A3 document to B-size paper?

 

 
Powered by phpBB® Forum Software