Bugs item #1824600, was opened at 2007-11-02 22:59
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1824600&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mustafa (goermezer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Type mismatch when using export fuction of PowerPoint 2007
Initial Comment:
Hi,
mabe it is a PowerPoint 2007 bug, but I couldn`t find a solution to use the function ExportAsFixedFormat of PowerPoint 2007. I get a value error (not a COM object) with following code. I think the ppFixedFormatIntentScreen constant must be of another type. Because without that constant it works fine. But I cannot set other constants?!
import glob, win32com.client, pythoncom
pptFiles = glob.glob('c:\\testdokumente\\ppt\\*.ppt')
for pptFile in pptFiles:
PPT=win32com.client.gencache.EnsureDispatch('powerpoint.application')
print 'Converting %s' % pptFile
#PPT.Activate()
presentation = PPT.Presentations.Open(pptFile, False, False, False)
presentation.ExportAsFixedFormat(pptFile+'.pdf', win32com.client.constants.ppFixedFormatTypePDF, win32com.client.constants.ppFixedFormatIntentScreen)
Output:
Converting c:\testdokumente\ppt\file_no_0.ppt
Traceback (most recent call last):
File "C:\Python25\Lib\SITE-P~1\PYTHON~1\pywin\framework\scriptutils.py", line 310, in RunScript
exec codeObject in __main__.__dict__
File "C:\Dokumente und Einstellungen\mgo\Desktop\ppt_getobject.py", line 9, in <module>
presentation.ExportAsFixedFormat(pptFile+'.pdf', win32com.client.constants.ppFixedFormatTypePDF, win32com.client.constants.ppFixedFormatIntentScreen)
File "C:\DOKUME~1\mgo\LOKALE~1\Temp\gen_py\2.5\91493440-5A91-11CF-8700-00AA0060263Bx0x2x9.py", line 7866, in ExportAsFixedFormat
, KeepIRMSettings, DocStructureTags, BitmapMissingFonts, UseISO19005_1, ExternalExporter
File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 448, in _ApplyTypes_
dispid, 0, wFlags, retType, argTypes, *args),
ValueError: argument is not a COM object
>>>
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2007-11-03 11:06
Message:
Logged In: YES
user_id=14198
Originator: NO
"ValueError: argument is not a COM object" generally means that one of the
params is expecting an object, not a simple type such as an integer. You
might like to post your question to the pyt...@py... mailing
list where more people will see it
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1824600&group_id=78018
|