Reputation: 77
How can I open the password-protected PowerPoint presentation using C# or VBA,in excel workbook.open
the method has a password parameter. But in PowerPoint, it does not have.
In PowerPoint Presentation.Open
method does not have a password parameter
In Excel, I can use
Application.Workbooks.Open(Filename,Password)
But there is no equivalent in PowerPoint
I need to pass the password during PowerPoint document open
Upvotes: 2
Views: 1100
Reputation: 6664
This will Work: Tested in VBA
Dim PVW As ProtectedViewWindow, Pres As Presentation
Set PVW = ProtectedViewWindows.Open("Full Path ", "Password")
Set Pres = PVW.Edit("modify")
Another Method: Untested
Sub SetPassword()
With Presentations.Open(FileName:="C:\My Documents\Earnings.ppt")
.Password = complexstrPWD 'global variable
.Save
.Close
End With
End Sub
Taken From: Link
Upvotes: 3