# Add Slides to Presentations in C++

> Easily add slides to your PowerPoint and OpenDocument presentations using Aspose.Slides for C++ — seamless, efficient slide insertion in seconds.

Source: https://docs.aspose.com/slides/cpp/add-slide-to-presentation/
Updated: 2026-08-02


## **Overview**

Aspose.Slides allows you to add slides to PowerPoint presentations programmatically. A presentation contains master/layout slides and normal slides, and normal slides are arranged by a zero-based index. Each slide has a unique ID, and presentation files without slides are not supported.

This article explains how to create a `Presentation` object, access its slide collection, add an empty slide, work with the newly added slide, and save the updated presentation. It also covers related points such as inserting slides at a specific position, using layouts, and understanding the blank slide that exists in a newly created presentation.

## **Add a Slide to a Presentation**
Before talking about adding slides to the presentation files, let us discuss some facts about the slides. Each PowerPoint presentation file contains Master / Layout slide and other Normal slides. It means that a presentation file contains at least one or more slides. It is important to know that presentation files without slides are not supported by Aspose.Slides for C++. Each slide has unique Id and all the Normal Slides are arranged in an order specified by the zero based index. Aspose.Slides for C++ allows developers to add empty slides to their presentation. To add an empty slide in the presentation, please follow the steps below:

- Create an instance of [Presentation](https://reference.aspose.com/slides/cpp/aspose.slides/presentation/) class.
- Instantiate [ISlideCollection](https://reference.aspose.com/slides/cpp/aspose.slides/islidecollection/) class by setting a reference to the Slides (collection of content Slide objects) property exposed by the Presentation object.
- Add an empty slide to the presentation at the end of the content slides collection by calling the AddEmptySlide methods exposed by ISlideCollection object
- Do some work with the newly added empty slide.
- Finally, write the presentation file using the [Presentation](https://reference.aspose.com/slides/cpp/aspose.slides/presentation/) object.

{{< gist "aspose-slides" "a690df625dc0b1fff869ab198affe7a4" "Examples-SlidesCPP-AddSlides-AddSlides.cpp" >}}

## **FAQ**

### Can I insert a new slide at a specific position, not just at the end?

Yes. The library supports slide collections and [insert](https://reference.aspose.com/slides/cpp/aspose.slides/slidecollection/insertemptyslide/)/[clone](https://reference.aspose.com/slides/cpp/aspose.slides/slidecollection/insertclone/) operations, so you can add a slide at the required index rather than only at the end.

### Are the theme/styles preserved when adding a slide based on a layout?

Yes. A layout inherits formatting from its master, and the new slide inherits from the selected layout and its associated master.

### Which slide is present in a new "empty" presentation before adding slides?

A newly created presentation already contains one blank slide with index zero. This is important to consider when calculating insertion indices.

### How do I choose the "right" layout for a new slide if the master has many options?

Generally choose the [LayoutSlide](https://reference.aspose.com/slides/cpp/aspose.slides/layoutslide/) that matches the required structure ([Title and Content, Two Content, etc.](https://reference.aspose.com/slides/cpp/aspose.slides/slidelayouttype/)). If such a layout is missing, you can [add it to the master](/slides/cpp/slide-layout/) and then use it.

