I am trying to paste multiple slides from a different PPTs in an existing PPT. I could paste multiple slides but issue is formating of slides is not preserved. my code is as follows
Presentation Pres = pptApp.Presentations.Open("Original.pptx", MsoTriState.msoFalse, MsoTriState.msoFalse, MsoTriState.msoFalse);
int counter = 1;
//slideNumbers is a list of slide numbers or position at which we are going to insert the slide in original file
foreach (var number in slideNumbers)
{
if (pres != null)
{
pres.Slides[number].Delete();
pres.Slides.InsertFromFile("temp.pptx", number- 1, counter, counter);
counter++;
}
}
}
if (pres != null)
{
pres.SaveAs("Final.pptx");
pres.Close();
Marshal.ReleaseComObject(pres);
}
I found the VBA equivalent of what I'm searching for, but couldn't convert it into C#. (Refer: Programmatically combine slides from multiple presentations into a single presentation)
I need solution in c#. Thank you !