Shape SaveAs/Export function

  • Thread starter Thread starter Ze Seb
  • Start date Start date
Z

Ze Seb

Hi all,

On powerpoint XP, I've seen there is a fabulous function which can be
applied on a shape. This function is rightclick / SaveAs... (not sure
of the exact text because I've a french version of powerpoint).

I've seen that in VBA the function is called export (appear in the VBA
help file but not documented), but it does not appear in the function
list while I put a . after a shape variable. But if I put the function
anyway, vba works and export my shape as an image... wow cool... But
the problem is that I am in C++ automation, and this function is not
accessible in the generated Shape class. I've parse the generated
msppt.tlh and the function is present in the Shape class as virtual,
like all others, but is not present in the final msppt.h.

So my question is : Is there a way to access this function in the
msppt.h or is impossible in c++?

This function is very very usefull for me as I want to export each
shape as an image. For now I export the slide as HTML and search each
shape in the generated images... I know it's not the good way...

Thanks for your help,

Ze Seb
 
Thanks for your reply,

Ok I've seen why... I use the MFC class wizard to generate the msppt.h
file. And this f***king wizard has not generate the Export function
for the Shape class.
So my import statements seems to have not effect since I use the
msppt.h file and its generated classes...
I've got a real problem since my whole application is wrote using MFC
generated classes... :( So, does anyone can tell me how can I pass my
Shape object (MFC generated class WITHOUT Export function) to an
object (seems to be PowerPoint::Shape WITH export function) of the
generated class (msppt.tlh)? I think it should be easy to do that but
I'm a very newbie in the COM world...

Thanks

Ze Seb
 
Ok I found the solution...
PowerPoint::ShapePtr shapeptr = MFCShape.m_lpDispatch;
shapeptr->Export( _bstr_t((LPCTSTR)imageFileName),
PowerPoint::ppShapeFormatJPG, MFCShape.GetWidth(),
MFCShape.GetHeight(), PowerPoint::ppRelativeToSlide );

wow. It has really simplify my code.

Thanks

Ze Seb
 
Back
Top