Microsoft Office 2000/Visual Basic Programmer's Guide   

Working with Open Presentations

You create a reference to an open presentation in two ways: by using the Application object's ActivePresentation property or by accessing a Presentation object as a member of the Presentations collection. There are three ways you can access a Presentation object through the Presentations collection:

The following examples illustrate the different ways to set a reference to an open presentation:

Dim prsPres As PowerPoint.Presentation

' Use the ActivePresentation property.
Set prsPres = ActivePresentation

' Use the presentation's file name.
Set prsPres = Presentations("PowerPointTools.ppt")

' Use the Caption property setting of the Window 
' object that contains the presentation.
Set prsPres = Presentations("PowerPointTools")

' Use the presentation's index value in the collection.
Set prsPres = Presentations(1)