Class Presentations (PowerPoint VBA)

A collection of all the Presentation objects in Microsoft PowerPoint. Each Presentation object represents a presentation that's currently open in PowerPoint. To use a Presentations class variable it first needs to be instantiated, for example


Dim prs as Presentations
Set prs = Presentations

Add

Creates a presentation. Returns a Presentation object that represents the new presentation.

The WithWindow parameter value can be one of these MsoTriState constants.

Add (WithWindow)

WithWindow: Whether the presentation appears in a visible window.


Dim prs As Presentation
Set prs = Presentations.Add()

CanCheckOut

Returns True if Microsoft PowerPoint can check out a specified presentation from a server.

To take advantage of the collaboration features built into PowerPoint, you must store presentations on a Microsoft Office SharePoint Portal Server.

CanCheckOut (FileName)

FileName: The server path and name of the presentation.


Sub CheckOutPresentation(strPresentation As String)
    If Presentations.CanCheckOut(strPresentation) = True Then
        Presentations.CheckOut FileName:=strPresentation
    Else
        MsgBox "You are unable to check out this " & _
        "presentation at this time."
    End If
End Sub

CheckOut

Copies a specified presentation from a server to a local computer for editing. Returns a String that represents the local path and file name of the presentation checked out.

To take advantage of the collaboration features built into Microsoft PowerPoint, presentations must be stored on a Microsoft Office SharePoint Portal Server.

CheckOut (FileName)

FileName: The server path and name of the presentation.

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = Presentations.Count

Item

Returns a single Presentation object from the specified Presentations collection.

Item (Index)

Index: The name or index number of the single Presentation object in the collection to be returned.


Dim prs As Presentation
Set prs = Presentations(Index:=1)

Open

Opens the specified presentation. Returns a Presentation object that represents the opened presentation.

With the proper file converters installed, Microsoft Office PowerPoint 2003 and earlier versions open files with the following MS-DOS file name extensions: .ch3, .cht, .doc, .htm, .html, .mcw, .pot, .ppa, .pps, .ppt, .pre, .rtf, .sh3, .shw, .txt, .wk1, .wk3, .wk4, .wpd, .wpf, .wps, and .xls. PowerPoint also opens files with the following file name extensions: .docm, .docx, .mhtml, .potm, .potx, .ppam, .pptm, .pptx, .ppsm, .ppsx, .thmx, .xlsm, and .xlsx. The ReadOnly parameter value can be one of these MsoTriState constants.

Open (FileName, ReadOnly, Untitled, WithWindow)


Presentations.Open FileName:="C:\My Documents\pres1.pptx", ReadOnly:=msoTrue

Arguments

The following argument is required

FileName (String) - The name of the file to open.

Optional arguments

The following arguments are optional

ReadOnly (Office.MsoTriState) - Specifies whether the file is opened with read/write or read-only status.

Untitled (Office.MsoTriState) - Specifies whether the file has a title.

WithWindow (Office.MsoTriState) - Specifies whether the file is visible.

Open2007

Opens the specified presentation and provides the option to repair the presentation file. Returns a Presentation object that represents the opened presentation.

With the proper file converters installed, Microsoft Office PowerPoint 2003 and earlier versions open files with the following MS-DOS file name extensions: .ch3, .cht, .doc, .htm, .html, .mcw, .pot, .ppa, .pps, .ppt, .pre, .rtf, .sh3, .shw, .txt, .wk1, .wk3, .wk4, .wpd, .wpf, .wps, and .xls. PowerPoint also opens files with the following file name extensions: .docm, .docx, .mhtml, .potm, .potx, .ppam, .pptm, .pptx, .ppsm, .ppsx, .thmx, .xlsm, and .xlsx. The ReadOnly parameter value can be one of these MsoTriState constants.

Open2007 (FileName, ReadOnly, Untitled, WithWindow, OpenAndRepair)


Presentations.Open2007 FileName:="C:\My Documents\pres1.ppt", ReadOnly:=msoTrue, OpenAndRepair:=msoTrue

Arguments

The following argument is required

FileName (String) - The name of the file to open.

Optional arguments

The following arguments are optional

ReadOnly (Office.MsoTriState) - Specifies whether the file is opened with read/write or read-only status.

Untitled (Office.MsoTriState) - Specifies whether the file has a title.

WithWindow (Office.MsoTriState) - Specifies whether the file is visible.

OpenAndRepair (Office.MsoTriState) - Specifies whether to repair the file before it is opened to prevent corruption.