Getting pictures ON slides (not thumbnails!) from powerpoint

S

Sumit Gupta

Hi,

How can I save each image on a powerpoint slide using OLE automation? I
have been able to get a loop to run, where I can enumerate each shape
in each slide. I can even determine which shape is a picture using it's
type, but after that, I'm stumped.

I tried a select and copy, then paste it to my app to create a file,
but pictures copied like this have extremely poor quality (even if
manually copied and pasted from Powerpoint to, say, MSPaint or
Photoshop).

Basically, I need to save the picture just like the 'Save Picture
As...' option available in Powerpoint in the picture context menu. Or,
better still, get the picture stream itself directly into my
application.

Thanks!
 
S

Steve Rindsberg

Sumit Gupta said:
Hi,

How can I save each image on a powerpoint slide using OLE automation? I
have been able to get a loop to run, where I can enumerate each shape
in each slide. I can even determine which shape is a picture using it's
type, but after that, I'm stumped.

Use the shape's .Export method

Or if you save the presentation as a web page, you'll get the original image in
full resolution, but it'll take more work to sort out what images correlate to
which slides/shapes.
 
S

Sumit Gupta

Thanks Steve,

I can't find an 'export' method for shape. At least, not in the Object
Browser in the VBA Editor. Where can I find more info about it?I'm
using MSOffice 10.

Also, is there any way of directly accessing the original image?
Something like shape.picture which fetches the raw data (bitmap or jpg
or whatever).

Thanks again,

Sumit.
 
S

Steve Rindsberg

I can't find an 'export' method for shape. At least, not in the Object
Browser in the VBA Editor. Where can I find more info about it?I'm
using MSOffice 10.

Oops. Sorry. Rightclick the "Members" area of the object browser and choose
Show Hidden Members.
Also, is there any way of directly accessing the original image?

Yes and no. If the original image wasn't JPG, PNG or GIF, it was converted
into one of those formats at import, but the image data should still be
present.
Something like shape.picture which fetches the raw data (bitmap or jpg
or whatever).

Afraid not. If you copy the image to the clipboard, it'll be there, but in a
private format; if you paste into anything but MS PhotoEditor, you'll get the
image PPT was displaying on screen, not the original. If you can manipulate
the clipboard at a much lower level than VBA is capable of, you may be able to
get the image you need. Don't ask me how ... I'm not a C guy. <g>

That's why I mentioned exporting to HTML. Amongst all the other litter, you do
get the full resolution image equivalent to the original.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top