printing to file from MS Word

Tomaz Ficko tomaz.ficko at
Fri Oct 26 14:50:44 CEST 2001

I want to write a doc to ps converter. I'm using python 1.5.2 and
win32all-136.  The folowing code should do it:

    word = win32com.client.Dispatch('Word.Application')
    word.ActivePrinter = "HP LaserJet 5P/5MP PostScript"
    doc = word.Documents.Open(FileName=os.path.abspath('test.doc'))
    doc.PrintOut(PrintToFile=1, OutputFile='', Background=1)

But there is one problem. When I run this code it allways brings up file
dialog for the name of *.prn file. How can I disable this.


More information about the Python-list mailing list