[python-win32] Generating Postscript from Word

Bob Gailer bgailer at alum.rpi.edu
Tue Apr 22 14:49:00 EDT 2003


At 08:28 PM 4/22/2003 +0100, Paul Browning wrote:
>from win32com.client import Dispatch
>myWord = Dispatch('Word.Application')
>myWord.Visible = 1
>myWord.Documents.Add('f:\\tests\\test1.doc')
>myWord.PrintOut()
>
>gives me hard-copy on my currently selected printer.
>
>However, I'd like to generate Postscript silently from Word. Doing
>
>myWord.ActivePrinter = 'Apple LaserWriter 16/600 PS'
>
>selects the right driver but I how do I pass a filename
>for the output so as to avoid the dialogue box that
>pops up?

doc = myWord.Documents.Add('f:\\tests\\test1.doc')
myWord.doc.PrintOut()

Make friends with the object browser in the visual basic editor under word. 
You could look up PrintOut and see which objects it applies to.

Bob Gailer
bgailer at alum.rpi.edu
303 442 2625
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003


More information about the Python-win32 mailing list