Password Property

Microsoft PowerPoint Visual Basic

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 = complexstrPWD 'global variable
        .Save
        .Close
    End With
End Sub