G
Goermezer, Mustafa (PROSTE)
Hello,
with CoInitializeEx it is possible for word, excel or powerpont to run in
multiple instances. So you can build a webbased converter to convert Office
documents with spyce and mod_python (I have tested it, it runs fine !):
Example for multiple instances:
pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)
myWord = win32com.client.DispatchEx('Word.Application')
myWord.Application.ActivePrinter="Printer name"
myDoc = myWord.Documents.Open("filename.doc", False, False, False)#please
see VBAWD10.CHM in Office directory
myDoc.Saved=1
myWord.PrintOut(True, False, 0, "postscriptfile.ps") ##please see
VBAWD10.CHM in Office directory
while myWord.BackgroundPrintingStatus > 0:
time.sleep(1)
myDoc.Close()
myWord.Quit()
del myDoc
del myWord
Ghost() #ghostscript-command to convert created postscript file to PDF
pythoncom.CoUninitialize()
A ready script to convert files in commandline is on my homepage
www.goermezer.de.
Python rulez !!!
Mustafa
with CoInitializeEx it is possible for word, excel or powerpont to run in
multiple instances. So you can build a webbased converter to convert Office
documents with spyce and mod_python (I have tested it, it runs fine !):
Example for multiple instances:
pythoncom.CoInitializeEx(pythoncom.COINIT_APARTMENTTHREADED)
myWord = win32com.client.DispatchEx('Word.Application')
myWord.Application.ActivePrinter="Printer name"
myDoc = myWord.Documents.Open("filename.doc", False, False, False)#please
see VBAWD10.CHM in Office directory
myDoc.Saved=1
myWord.PrintOut(True, False, 0, "postscriptfile.ps") ##please see
VBAWD10.CHM in Office directory
while myWord.BackgroundPrintingStatus > 0:
time.sleep(1)
myDoc.Close()
myWord.Quit()
del myDoc
del myWord
Ghost() #ghostscript-command to convert created postscript file to PDF
pythoncom.CoUninitialize()
A ready script to convert files in commandline is on my homepage
www.goermezer.de.
Python rulez !!!
Mustafa