[python-win32] saving an ole control object embedded in a powerpoint

Bertrand Mathieu bertrand.mathieu at ingeniweb.com
Mon Feb 20 15:52:20 CET 2006


Hi,

I have made a python program that extracts some informations out of
PowerPoint files, using MS-Powerpoint. It works well, but I also need to
extract Shockwave Flash from certain slides. I am able to get the OLE
object, but I can't figure out what to do with it so as to save its
content to a SWF file:

if shape.Type == constants.msoOLEControlObject:
    ole_format = shape.OLEFormat
    if ole_format.ProgID == u'ShockwaveFlash.ShockwaveFlash.1':
         pass # wish I could save flash content

After some investigation, it seems that this object implements the
IPersistStream interface.

I imagine I could use the Save(IStream) method, or better
pythoncom.OleSaveToStream(IPersistStream, IStream). 

The problem is that I don't know how to obtain something that would be
accepted as an IStream (through python/com machinery) and that would
write everything to a file or in a string, and that I can read later.

Finally, I don't really know if I am following the good direction.

Any clue?

Regards,
-- 
Bertrand Mathieu - INGENIWEB SAS
17 rue Louise Michel - 92300 Levallois Perret - France
Tel / Fax : (33) 1 47 57 39 14
web : www.ingeniweb.com - « les Services Web Ingénieux »



More information about the Python-win32 mailing list