IRONSOFTWAREHOME
Manage Slide
using IronPPT;
using IronPPT.Models;

var document = new PresentationDocument();

document.AddSlide();
document.AddSlide();

// Remove slide
document.Slides.RemoveAt(0);

// Move slide by removing it and re-inserting it at the desired position.
var slide = document.Slides[0];
document.Slides.Remove(slide);
document.Slides.Insert(1, slide);

// Hide slide
document.Slides[0].Show = false;

document.Save("manageSlide.pptx");
Imports IronPPT
Imports IronPPT.Models

Dim document = New PresentationDocument()

document.AddSlide()
document.AddSlide()

' Remove slide
document.Slides.RemoveAt(0)

' Move slide by removing it and re-inserting it at the desired position.
Dim slide = document.Slides(0)
document.Slides.Remove(slide)
document.Slides.Insert(1, slide)

' Hide slide
document.Slides(0).Show = False

document.Save("manageSlide.pptx")
NuGet Download
PM > Install-Package IronPPT
Manage Slide

Manage Slide

When it comes to working with PowerPoint programmatically, the straightforward process of managing slides within IronPPT empowers developers to streamline efficiency and automate tasks on a large scale. With a single command, you can remove slides, change slide numbers, and hide slides, giving you complete control over their placement and appearance.

5-Step Guide to Using IronPPT to Manage Slides

  • document.AddSlide();
  • document.Slides.RemoveAt(0);
  • var slide = document.Slides[0]; document.Slides.Remove(slide); document.Slides.Insert(1, slide);
  • document.Slides[0].Show = false;
  • document.Save("manageSlide.pptx");

Code Explanation

First, we instantiate a new PresentationDocument. Then, to add a slide, we call AddSlide to add an empty slide.

The PresentationDocument has a property named Slides which is just a list of slides currently in the object and can be accessed and used as an array. As such, removing a slide is simple; all we have to do is locate the index of the slide and call the RemoveAt method on the Slides list to remove it. It's important to note that the index for arrays starts at 0, not 1. Therefore, the first slide is located at index 0. Incorrect usage of the index can lead to array out of bounds errors, so it's crucial to use the correct index when working with slides.

Similarly, we can change the order of the slides by removing a slide from its current position in the Slides list and inserting it back at the desired index. In the example above, we move the first slide from index 0 to index 1 by removing it and then inserting it at position 1.

Finally, to hide a slide, we first access the slide by providing an index to the Slides property and set the Show property to false. The Show property controls whether the slide is visible or not. Setting it to false hides the slide from view.

Explore IronPPT Slide Management Techniques
View on GitHub

Ready to Get Started?

Nuget Downloads 6,070Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required