I cannot seem to get this to work. I just want to take a list of PPTX files and output 1 presentation.
Works just fine if I comment out the for loop.
//Creates a new instance of PowerPoint Presentation
IPresentation presentation = Presentation.Create();
BuildCover(presentation);
foreach (var file in _files)
{
if (!string.IsNullOrEmpty(file))
{
var libraryFileName = Server.MapPath("~//images//" + _clientFolder + "//" + file);
if (File.Exists(libraryFileName))
{
var p = Presentation.Open(libraryFileName);
foreach (var childSlide in p.Slides)
{
presentation.Slides.Add(childSlide);
}
//p.Close();
}
}
}
presentation.Save("SamplePresentation.pptx", FormatType.Pptx, Response);