Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Creates a new slide, adds it to the Slides collection, and returns the slide.
Syntax
expression. AddSlide( _Index_, _Layout_ )
expression An expression that returns a Slides object.
Parameters
| Name | Required/Optional | Data type | Description |
|---|---|---|---|
| Index | Required | Int | The index of the slide to be added. |
| Layout | Required | PpSlideLayout | The layout of the slide. |
Return value
Slide
Example
The following example shows how to use the Add method to add a new slide to the Slides collection. It adds a new slide in index position 1 with the blank layout.
Public Sub Add_Example()
Dim pptSlide As Slide
Set pptSlide = ActivePresentation.Slides.AddSlide(1, ppLayoutBlank)
End Sub
Remarks
See PpSlideLayout enumeration for all available layouts. For custom slide layouts, use Slides.AddSlide instead.
This method is hidden from the VBA Object Browser, but is still available to use.
If your Visual Studio solution includes the Microsoft.Office.Interop.PowerPoint reference, this method maps to the following type:
- Microsoft.Office.Interop.PowerPoint.Slides.Add(int, Microsoft.Office.Interop.PowerPoint.PpSlideLayout)
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.