I use Word 2013 to automatically generate a report as docx and then save it in pdf format.
But when I call the SaveAs2 () function, the script pulls out the Save As windows and throws this exception:
(-2147352567, 'Exception occurred.', (0, u'Microsoft Word', u'Command failed', u'wdmain11.chm', 36966, -2146824090), None)
Here is my code to open and save as a new file:
self.path = os.path.abspath(path) self.wordApp = win32.Dispatch('Word.Application')
And I use: python2.7 with pywin32 (build 219)
Does anyone have an idea why this is not working?
python word-2013 pywin32
Renshan
source share