Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Split PowerPoint Presentations using C#
// Load PowerPoint presentation
using (Presentation pres = new Presentation("presentation.pptx"))
{
// Loop through slides
foreach(ISlide slide in pres.Slides)
{
// Create a new empty presentation
using (Presentation newPres = new Presentation())
{
// Remove default slide
newPres.Slides[0].Remove();
// Add slide to presentation
newPres.Slides.AddClone(slide);
// Save presentation
newPres.Save(string.Format("Slide_{0}.pptx", slide.SlideNumber), SaveFormat.Pptx);
}
}
}
@stasmiroshnichenko

This comment has been minimized.

Copy link

@stasmiroshnichenko stasmiroshnichenko commented Sep 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment