Class Presentation (PowerPoint VBA)

The class Presentation represents a Microsoft PowerPoint presentation.

The main procedures of class Presentation are Close and Presentations.Add


To use a Presentation class variable it first needs to be instantiated, for example

Dim prs as Presentation
Set prs = ActivePresentation

The following procedures can be used to set variables of type Presentation: Application.ActivePresentation, DocumentWindow.Presentation, Presentations.Item, Presentations.Add, Presentations.Open, Presentations.Open2007, ProtectedViewWindow.Presentation, ProtectedViewWindow.Edit, SlideShowWindow.Presentation and Application.Presentations


Some procedures in this class have been grouped together in themes and are described on separate theme pages

Add with its procedures AddTitleMaster, AddToFavorites and Presentations.Add
Format with its procedures ApplyTheme, ColorSchemes, EnvelopeVisible, ExtraColors, Fonts, LayoutDirection, RemoveDocumentInformation and RemovePersonalInformation
Save with its procedures AutoSaveOn, CanCheckIn, CheckIn, CheckInWithVersion, Save, SaveAs, SaveCopyAs, SaveCopyAs2 and Saved
Data with its procedures ChartDataPointTrack and CustomerData
Create with its procedures CreateVideo and CreateVideoStatus
Display/Show with its procedures DisplayComments, SlideShowSettings and SlideShowWindow
Import/Export with its procedures Export, ExportAsFixedFormat and ExportAsFixedFormat2
Name with its procedures FullName, Name and TemplateName
Password/Protect with its procedures Password, PasswordEncryptionAlgorithm, PasswordEncryptionFileProperties, PasswordEncryptionKeyLength, PasswordEncryptionProvider, SetPasswordEncryptionOptions and WritePassword
Print with its procedures PrintOptions and PrintOut
Open with its procedures Presentations.CanCheckOut, Presentations.CheckOut, Presentations.Open and Presentations.Open2007


These are the main methods of the Presentation class

Close - Closes the specified presentation.


Other Methods

ApplyTemplate2 - Applies a design template and theme variant to the presentation.

Dim strFileName As String: strFileName = 
Dim strVariantGUID As String: strVariantGUID = 
ActivePresentation.ApplyTemplate2 FileName:=strFileName, VariantGUID:=strVariantGUID

FollowHyperlink - Displays a cached document, if it has already been downloaded. Otherwise, this method resolves the hyperlink, downloads the target document and displays it in the appropriate application.

Dim strAddress As String: strAddress = 
ActivePresentation.FollowHyperlink Address:=strAddress

MergeWithBaseline - Merges a presentation into another presentation.

Dim strwithPresentation As String: strwithPresentation = 
Dim strbaselinePresentation As String: strbaselinePresentation = 
ActivePresentation.MergeWithBaseline withPresentation:=strwithPresentation, baselinePresentation:=strbaselinePresentation

PublishSlides - Creates a Web presentation (in HTML format) containing slides from any loaded presentation. You can view the published presentation in a web browser.

Dim strSlideLibraryUrl As String: strSlideLibraryUrl = 
ActivePresentation.PublishSlides SlideLibraryUrl:=strSlideLibraryUrl

SendFaxOverInternet - Sends a presentation as a fax to the specified recipients.



Broadcast returns the Broadcast object of the current Presentation object.

Dim brdBroadcast As Broadcast
Set brdBroadcast = ActivePresentation.Broadcast

BuiltInDocumentProperties returns a DocumentProperties collection that represents all the built-in document properties for the specified presentation. Read-only.

Dim dpsBuiltInDocumentProperties As DocumentProperties
dpsBuiltInDocumentProperties = ActivePresentation.BuiltInDocumentProperties

Coauthoring returns a Coauthoring object in the current Presentation object.

Dim cthCoauthoring As Coauthoring
Set cthCoauthoring = ActivePresentation.Coauthoring

CommandBars returns a CommandBars collection that represents the merged command bar set from the host container application and Microsoft PowerPoint. This property returns a valid object only when the container is a DocObject server, like Microsoft Binder, and PowerPoint is acting as an OLE server.

Dim cbsCommandBars As Office.CommandBars
Set cbsCommandBars = ActivePresentation.CommandBars

Container returns the object that contains the specified embedded presentation. Read-only.

Dim objContainer As Object
Set objContainer = ActivePresentation.Container

ContentTypeProperties returns the Microsoft Office MetaProperties collection that describes the metadata stored in the presentation.

Dim mpsContentTypeProperties As Office.MetaProperties
Set mpsContentTypeProperties = ActivePresentation.ContentTypeProperties

CustomDocumentProperties returns a DocumentProperties collection that represents all the custom document properties for the specified presentation. Read-only.

Dim dpsCustomDocumentProperties As DocumentProperties
dpsCustomDocumentProperties = ActivePresentation.CustomDocumentProperties

CustomXMLParts returns a CustomXMLParts object that represents the collection of custom XML parts associated with the specified Presentation object.

Dim cxmsCustomXMLParts As Office.CustomXMLParts
Set cxmsCustomXMLParts = ActivePresentation.CustomXMLParts

DefaultLanguageID returns or sets the default language of a presentation.

ActivePresentation.DefaultLanguageID = msoLanguageIDMixed

DefaultShape returns a Shape object that represents the default shape for the presentation.

Dim shpDefaultShape As Shape
Set shpDefaultShape = ActivePresentation.DefaultShape

Designs returns a Designs object that represents a collection of designs.

Dim dsgsDesigns As Designs
Set dsgsDesigns = ActivePresentation.Designs

DocumentInspectors returns the Microsoft Office DocumentInspectors collection.

Dim disDocumentInspectors As Office.DocumentInspectors
Set disDocumentInspectors = ActivePresentation.DocumentInspectors

DocumentLibraryVersions returns a DocumentLibraryVersions collection that represents the collection of versions of a shared presentation that has versioning enabled and that is stored in a document library on a server.

Dim dlvsDocumentLibraryVersions As Office.DocumentLibraryVersions
Set dlvsDocumentLibraryVersions = ActivePresentation.DocumentLibraryVersions

EncryptionProvider returns a String that specifies the name of the algorithm encryption provider that PowerPoint uses when encrypting documents.

ActivePresentation.EncryptionProvider =

FarEastLineBreakLanguage returns or sets the language used to determine which line break level is used when the line break control option is turned on.

ActivePresentation.FarEastLineBreakLanguage = MsoFarEastLineBreakLanguageJapanese

FarEastLineBreakLevel returns or sets the line break based upon Asian character level.

ActivePresentation.FarEastLineBreakLevel = ppFarEastLineBreakLevelCustom

Final determines whether the presentation is marked as final (read-only).

ActivePresentation.Final = True

GridDistance sets or returns a Single that represents the distance between gridlines.

ActivePresentation.GridDistance = 18

Guides returns the Guides collection associated with a custom layout.

Dim gdsGuides As Guides
Set gdsGuides = ActivePresentation.Guides

HandoutMaster returns a Master object that represents the handout master.

Dim mstHandoutMaster As Master
Set mstHandoutMaster = ActivePresentation.HandoutMaster

HasHandoutMaster indicates whether the presentation has media that resides on a handout master. Read-only

Dim booHasHandoutMaster As Boolean
booHasHandoutMaster = ActivePresentation.HasHandoutMaster

HasNotesMaster indicates whether the presentation has media that resides on a notes master.

Dim booHasNotesMaster As Boolean
booHasNotesMaster = ActivePresentation.HasNotesMaster

HasTitleMaster msoTrue if the specified presentation has a title master.

Dim mtsHasTitleMaster As Office.MsoTriState
mtsHasTitleMaster = ActivePresentation.HasTitleMaster

HasVBProject returns whether the active presentation contains a Microsoft Visual Basic for Applications (VBA) project.

Dim booHasVBProject As Boolean
booHasVBProject = ActivePresentation.HasVBProject

InMergeMode indicates whether the document window is in merge mode. Read-only

Dim booInMergeMode As Boolean
booInMergeMode = ActivePresentation.InMergeMode

NoLineBreakAfter returns or sets the characters that cannot end a line.

ActivePresentation.NoLineBreakAfter =

NoLineBreakBefore returns or sets the characters that cannot begin a line.

ActivePresentation.NoLineBreakBefore =

NotesMaster returns a Master object that represents the notes master.

Dim mstNotesMaster As Master
Set mstNotesMaster = ActivePresentation.NotesMaster

PageSetup returns a PageSetup object whose properties control slide setup attributes for the specified presentation.

Dim pspPageSetup As PageSetup
Set pspPageSetup = ActivePresentation.PageSetup

Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = ActivePresentation.Parent

Path returns a String that represents the path to the specified Presentation object.

Dim strPath As String
strPath = ActivePresentation.Path

Permission expression. Permission

Dim prmPermission As Office.Permission
Set prmPermission = ActivePresentation.Permission

ReadOnly returns whether the specified presentation is read-only.

Dim mtsReadOnly As Office.MsoTriState
mtsReadOnly = ActivePresentation.ReadOnly

ReadOnlyRecommended true if the presentation was saved as read-only recommended.

Dim booReadOnlyRecommended As Boolean
booReadOnlyRecommended = ActivePresentation.ReadOnlyRecommended

Research returns a Research object that provides access to the research service feature of Microsoft PowerPoint.

Dim rsrResearch As Research
Set rsrResearch = ActivePresentation.Research

SectionProperties returns a SectionProperties object.

Dim spsSectionProperties As SectionProperties
Set spsSectionProperties = ActivePresentation.SectionProperties


Dim islSensitivityLabel As Office.ISensitivityLabel
islSensitivityLabel = ActivePresentation.SensitivityLabel

ServerPolicy returns a Microsoft Office ServerPolicy object.

Dim spyServerPolicy As Office.ServerPolicy
Set spyServerPolicy = ActivePresentation.ServerPolicy

SharedWorkspace this object or member has been deprecated, but it remains part of the object model for backward compatibility. You should not use it in new applications.

Dim sweSharedWorkspace As Office.SharedWorkspace
Set sweSharedWorkspace = ActivePresentation.SharedWorkspace

Signatures returns a SignatureSet object that represents a collection of digital signatures.

Dim sstSignatures As Office.SignatureSet
Set sstSignatures = ActivePresentation.Signatures

SlideMaster returns a Master object that represents the slide master.

Dim mstSlideMaster As Master
Set mstSlideMaster = ActivePresentation.SlideMaster

Slides returns a Slides collection that represents all slides in the specified presentation.

Dim sldsSlides As Slides
Set sldsSlides = ActivePresentation.Slides

SnapToGrid determines whether to snap shapes to the gridlines in the specified presentation.

ActivePresentation.SnapToGrid = msoTrue

Sync this object or member has been deprecated, but it remains part of the object model for backward compatibility. You should not use it in new applications.

Dim synSync As Office.Sync
Set synSync = ActivePresentation.Sync

Tags returns a Tags object that represents the tags for the specified object.

Dim tgsTags As Tags
Set tgsTags = ActivePresentation.Tags

TitleMaster returns a Master object that represents the title master for the specified presentation.

Dim mstTitleMaster As Master
Set mstTitleMaster = ActivePresentation.TitleMaster

VBASigned determines whether the Visual Basic for Applications (VBA) project for the specified document has been digitally signed.

Dim mtsVBASigned As Office.MsoTriState
mtsVBASigned = ActivePresentation.VBASigned

VBProject returns a VBProject object that represents the individual Visual Basic project for the presentation.

Dim vbpVBProject As VBIDE.VBProject
Set vbpVBProject = ActivePresentation.VBProject

Windows returns a DocumentWindows collection that represents all document windows associated with the specified presentation.

Dim dwsWindows As DocumentWindows
Set dwsWindows = ActivePresentation.Windows


ActivePresentation.WorkIdentity =

Presentations.Count returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = Presentations.Count

Presentations.Parent returns the parent object for the specified object.

Dim objParent As Object
Set objParent = Presentations.Parent