Create a Presentation in PowerPoint using VBA

The presentation object is the main object used in VBA for PowerPoint. If you are familiar with VBA for Excel, you can consider the Presentation object as the Workbook of the project.

Contents

Access A Presentation Object:

The presentation objects can be accessed through the Presentations
collection:

Dim objPresentation As Presentation
Set objPresentation = Presentations.Item(3)

Access Active Presentation Object:

The active presentation object can be accessed using the code below:

Dim objPresentation As Presentation
Set objPresentation = ActivePresentation

Create New Presentation Object:

The following code will create a new presentation object:

Dim objPresentation As Presentation
Set objPresentation = Presentations.Add(msoTrue)

Before:
1

After:
2

Note: If you change msoTrue to msoFalse a new presentation object will be created but it won’t be visible.

Leave a Reply

Your email address will not be published. Required fields are marked *