Hi to all COM warriors! I just deal with a powerpoint import function. At the moment I'm able to remote-launch powerpoint, open a ppt file and enumerate all slides and the elements (shapes) on the slides. I get an IDispatch handle for every object, and can access the automation features with it. What I cannot solve is - how to get the data out of the object? If I insert an image (f.e. BMP or JPG) into PowerPoint, I find no way to get the image data out of the element. I made a way over the clipoard with a "Copy" and "Paste" operation, but this way I get only a bitmap and not the original data stream. beaster. * lost in OLE spaces *
I'm not familiar with Power Point, but in gerneral, to use any Automation server such as P Point you need to get it's documentation. The largest drawing will be the object hiarachy, which describes how the program's bits and pieces intereact with each other. For example, in Excel, to get the contents of a particular cell, you need to route thru something like: Val = Excel.Workbook(1).Cell(A1).Value That's VBish. In asm, you need to do these calls independently, as in get the Excel Object (perobably from a LoadObject on an existing sheet), use the Workbook method to get the book 1 object, Get the Cell peoperty of that (returns another object), then query that cell object for it's value property. Yes, it's many many steps.
thanks for reply. I got so far, to have the lowest object I need, in my case Presentation.Slides.Item(1).Shapes.Item(1). One of my example files contains a windows metafile in a powerpoint slide. I inserted it with "Insert"->"Graphic"->"Clipart" in my slide. I took one of the office default cliparts (flower.wmf). Internally it becomes an embedded OLE object. If I now dive into the object structure, I get at the last step an OLE object handle, which represents my flower.wmf as an OLE object. What I cannot solve is - how to get the original file data out of the object? The object has no corresponding methods, like GetData or GetRawData or something. I think, this is not only a question of powerpoint, but a common question of OLE objects.