C# Powerpoint Insert from File
Hi
As a part of an application that I am trying to develop, I need to insert slides from one powerpoint into another. This is the code I used for doing that...
Code:
-----------------------------------
mi_App = new Microsoft.Office.Interop.PowerPoint.Application();
mi_Pres1 = mi_App.Presentations.Open2007(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File1.pptx", MsoTriState.msoTrue,MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse);
mi_Pres1.Slides.InsertFromFile(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File2.pptx", 2, 1, 2);
mi_Pres1.SaveAs(@"D:\Visual Studio 2008\Projects\JoinPPT\JoinPPT\bin\Debug\File3.pptx", PpSaveAsFileType.ppSaveAsDefault, MsoTriState.msoFalse);
-----------------------------------
This does insert the contents of one slide into the other.. but the problem is that the background is not copied. The inserted slides take up the default background of the destination ppt.
I tried assigning background to
mi_Pres1.Slides[3].Background
But that did not work, because it is a readonly property.
Can someone tell me what is the right way of doing this?