Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active September 5, 2021 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/e100eb12855796c52c407ac2fa23eb10 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/e100eb12855796c52c407ac2fa23eb10 to your computer and use it in GitHub Desktop.
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
Copy link

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