extracting images from placeholder objs

G

Guest

Hi,

I'm using the C# API to extract images and text from PowerPoint slides. I
have no problems extracting text and pictures when they are the msoPicture
type. However, when pictures are within the Placeholder I don't know how to
determine that the ppPlaceholderObject contains a picture, and assuming that
it does and attempting to export it doesn't work. I'm pretty new to the
PowerPoint Object Model and its API so any help is appreciated.

Thanks!
 
S

Steve Rindsberg

Hi,

I'm using the C# API to extract images and text from PowerPoint slides. I
have no problems extracting text and pictures when they are the msoPicture
type. However, when pictures are within the Placeholder I don't know how to
determine that the ppPlaceholderObject contains a picture, and assuming that
it does and attempting to export it doesn't work. I'm pretty new to the
PowerPoint Object Model and its API so any help is appreciated.

Copy the picture, check the type of the copied shape.
If it's a picture, you know what to do with it.
If not, delete it.
 
G

Guest

Thanks for your response, Steve.

I'm not sure that I follow how to just "copy the picture". Wouldn't copying
the shape just make a copy of a placeholderformat shape of type
ppPlaceholderObject?

How do you copy the picture if you don't even know it's a picture? The
ppPlaceholderObject could also be a diagram, chart, table, media clip, etc.

Moreover, I don't know how to access the shape within the placeholder shape.
I'd appreciate any clarification to this.

Thanks!
Melanie
 
S

Steve Rindsberg

Thanks for your response, Steve.

I'm not sure that I follow how to just "copy the picture". Wouldn't copying
the shape just make a copy of a placeholderformat shape of type
ppPlaceholderObject?

No, because you can't create your own placeholders in PPT, nor can there be more
than one placeholder of a given type on a slide, so when you copy the placeholder,
PPT converts it to a normal shape (of the type contained in the original
placeholder).
How do you copy the picture if you don't even know it's a picture?The
ppPlaceholderObject could also be a diagram, chart, table, media clip, etc.

You copy first, then test to see what the .Type of the new shape is. If it's
something you want to work with, you're off to the races. If not, you delete it.

Make more sense?
Moreover, I don't know how to access the shape within the placeholder shape.
I'd appreciate any clarification to this.

There's no shape within the placeholder shape. It *IS* a placeholder shape, but
one that happens to contain other content.
 
G

Guest

Thanks a lot, Steve! That helped!

Steve Rindsberg said:
No, because you can't create your own placeholders in PPT, nor can there be more
than one placeholder of a given type on a slide, so when you copy the placeholder,
PPT converts it to a normal shape (of the type contained in the original
placeholder).


You copy first, then test to see what the .Type of the new shape is. If it's
something you want to work with, you're off to the races. If not, you delete it.

Make more sense?


There's no shape within the placeholder shape. It *IS* a placeholder shape, but
one that happens to contain other content.




-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

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