Password Property

Microsoft PowerPoint Visual Basic

Password Property

       

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

expression.Password

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

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

Sub SetPassword()
    With Presentations.Open(FileName:="C:\My Documents\Earnings.ppt")
        .Password = "why"
        .Save
        .Close
    End With
End Sub