Discussion:
extracting images from placeholder objs
(too old to reply)
melanie
2007-02-08 23:09:00 UTC
Permalink
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!
Steve Rindsberg
2007-02-09 04:58:25 UTC
Permalink
Post by melanie
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.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
melanie
2007-02-12 19:07:02 UTC
Permalink
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
Post by Steve Rindsberg
Post by melanie
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.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Steve Rindsberg
2007-02-12 22:55:19 UTC
Permalink
Post by melanie
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).
Post by melanie
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?
Post by melanie
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.
Post by melanie
Thanks!
Melanie
Post by Steve Rindsberg
Post by melanie
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.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
melanie
2007-02-13 01:50:13 UTC
Permalink
Thanks a lot, Steve! That helped!
Post by Steve Rindsberg
Post by melanie
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).
Post by melanie
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?
Post by melanie
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.
Post by melanie
Thanks!
Melanie
Post by Steve Rindsberg
Post by melanie
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.
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Loading...