[python-win32] Generating Postscript from Word

Paul Browning paul.browning at bristol.ac.uk
Tue Apr 22 22:24:32 EDT 2003



--On 22 April 2003 13:49 -0600 Bob Gailer <bgailer at alum.rpi.edu> wrote:

>> 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.

Wow - thanks. That's a voyage of discovery. I guess this is the right info:

Sub PrintOut([Background], [Append], [Range], [OutputFileName], [From],
[To], [Item], [Copies], [Pages], [PageType], [PrintToFile], [Collate],
[FileName], [ActivePrinterMacGX], [ManualDuplexPrint], [PrintZoomColumn],
[PrintZoomRow], [PrintZoomPaperWidth], [PrintZoomPaperHeight])

So I should do something like:

myWord.PrintOut(FileName='f:\\tests\\test1.ps', PrintToFile=1)
or
myWord.PrintOut(OutputFileName='f:\\tests\\test1.ps', PrintToFile=1)

?

I've tried those and a few others without success. How do I approach
this without wild guessing?

Paul

--
 The Library, Tyndall Avenue, Univ. of Bristol, Bristol, BS8 1TJ, UK
   E-mail: paul.browning at bristol.ac.uk  URL: http://www.bris.ac.uk/




More information about the Python-win32 mailing list