Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Problem of OLE Automation of Powerpoint 2010 with C++

$
0
0

Hi,

I'm playing with OLE automation of Powerpoint 2010 recently. I have written a piece of code as shown below. When the line "Shapes.AddPicture..." is executed, I always get an error. Who can tell be where am I wrong.

By the way, if Powerpoint 2003 is used, the code runs well. Thanks~

MSPPTApp = new CApplication0();
MSPPTApp.CreateDispatch(L"Powerpoint.Application");
CPresentations0 Presentations = MSPPTApp.get_Presentations();
CPresentation0 Presentation = Presentations.Add(FALSE);
CSlides0 Slides = Presentation .get_Slides();
CSlide0 Slide = Slides.Add((long)1, (long)1);
CShapes0 Shapes = Slide.get_Shapes();
Shapes.AddPicture(L"E:/image1.jpg", msoTrue, msoTrue, 0.0f, 0.0f, 100.0f, 100.0f);
Presentation.SaveAs(L"E:/1.pptx", ppSaveAsOpenXMLPresentation, 0);




Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>