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);