Share via


Presentation.Password Property

PowerPoint Developer Reference

Returns or sets the password that must be supplied to open the specified presentation. Read/write.

Syntax

expression.Password

expression   A variable that represents a Presentation object.

Return Value
String

Example

This example opens Earnings.ppt, sets a password for it, and then closes the presentation.

Visual Basic for Applications
  Sub SetPassword()
    With Presentations.Open(FileName:="C:\My Documents\Earnings.ppt")
        .Password = complexstrPWD 'global variable
        .Save
        .Close
    End With
End Sub

See Also