IRONSOFTWAREHOME
Add Slide
using IronPPT;
using IronPPT.Models;

// Create new PowerPoint presentation
var document = new PresentationDocument();

// Add empty slide
document.AddSlide(new Slide());

// Add slide object
Slide slide = new Slide();
slide.AddText("Hello!");
document.AddSlide(slide);

// Export PowerPoint presentation
document.Save("output.pptx");
Imports IronPPT
Imports IronPPT.Models

' Create new PowerPoint presentation
Dim document As New PresentationDocument()

' Add empty slide
document.AddSlide(New Slide())

' Add slide object
Dim slide As New Slide()
slide.AddText("Hello!")
document.AddSlide(slide)

' Export PowerPoint presentation
document.Save("output.pptx")
NuGet Download
PM > Install-Package IronPPT
Add Slide

Add Slide

IronPPT is a powerful library that allows you to automate PowerPoint creation. When it comes to adding slides programmatically, IronPPT has you covered, whether it's adding multiple slides or adding text elements onto them. IronPPT allows you to fully customize and add slides, then add text and other components with an intuitive method, all within one library.

In this example, we'll go through how to add a slide and add text to it as an example of what developers can add.

5-Step Code to Add Slides

  • var document = new PresentationDocument();
  • document.AddSlide(new Slide());
  • Slide slide = new Slide();
  • slide.AddText("Hello!");
  • document.AddSlide(slide/);

Code Explanation

Let's first import the IronPPT library and instantiate a new PresentationDocument, assigning it to a variable. This new PresentationDocument will be an empty PowerPoint presentation to which we will add slides.

Adding an Empty Slide

Adding an empty slide to PowerPoint is as simple as calling AddSlide with a new Slide object, e.g. document.AddSlide(new Slide()).

Adding a Slide with Text

In addition to adding an empty slide, we can also create a slide with various elements on it. In this example, we demonstrate adding text to the slide before adding it to the PresentationDocument. We first instantiate a new Slide object, then use the method AddText to add the text "Hello" onto it. Then, afterwards, we use the same AddSlide method as above, but provide the Slide to the AddSlide method to add onto it.

Finally, we save the edited PowerPoint presentation with Save.

Learn to Manage Slides with IronPPT
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