opening password protected powerpoints with vb rom other applicati

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hope the title says it all.

Can I open a powerpoint protected from editing but allowed for viewing with
a password with a third party application. This would give me the ability to
edit the powerpoint.

If I ca, then how would I go about it? I cannot find any open methods that
allow me to supply a password with as a parameter.

I would be using the third party app quasi as a key to open the powerpoint.
 
There is no VBA method to open a presentation protected with a password in
PowerPoint 2002/2003 nor is there a way to determine if the presentation is
password protected. However, if you know the password to a presentation,
then you can try and modify the following workaround if it suits you.

1. Open the main presentation and switch to Visual Basic Editor (Alt + F11)
2. Insert a code module into the VBA project.
3. Copy and paste the following snippet.
' ----------snippet -------
Option Explicit
Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public sPwd As String


Sub OpenPassPres()
Dim oPres As Presentation
TimerID = SetTimer(0, 0, 2000, AddressOf PassProc)
' Replace with your password
sPwd = "shyam"
' Replace E:\PresPass.ppt with your path to presentation
Call Presentations.Open("E:\prespas­s.ppt")
End Sub


Sub PassProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal idEvent As Long, _
ByVal dwTime As Long)
TimerID = KillTimer(0, TimerID)
SendKeys sPwd & "~"
End Sub
' --------End of Snippet ----
4. Run the macro - OpenPassPres.


You will notice the Password window momentarily and then the password will
be transmitted and the presentation will open.
 
Thanks Shyam,

It works! Excellent! Why is the timer needed?
I now only need to translate it into Lingo (Macromedia Directors langauge)
and hope it works with the VB Xtra!

Wish me luck!

NC

Shyam Pillai said:
There is no VBA method to open a presentation protected with a password in
PowerPoint 2002/2003 nor is there a way to determine if the presentation is
password protected. However, if you know the password to a presentation,
then you can try and modify the following workaround if it suits you.

1. Open the main presentation and switch to Visual Basic Editor (Alt + F11)
2. Insert a code module into the VBA project.
3. Copy and paste the following snippet.
' ----------snippet -------
Option Explicit
Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public sPwd As String


Sub OpenPassPres()
Dim oPres As Presentation
TimerID = SetTimer(0, 0, 2000, AddressOf PassProc)
' Replace with your password
sPwd = "shyam"
' Replace E:\PresPass.ppt with your path to presentation
Call Presentations.Open("E:\prespas­s.ppt")
End Sub


Sub PassProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal idEvent As Long, _
ByVal dwTime As Long)
TimerID = KillTimer(0, TimerID)
SendKeys sPwd & "~"
End Sub
' --------End of Snippet ----
4. Run the macro - OpenPassPres.


You will notice the Password window momentarily and then the password will
be transmitted and the presentation will open.
 
WHOA -
Is there really no way to determine if a presentation is password
protected? I was thinking I would try and open the presentation, and read the
error code to see why I can't open it... would this work?

Shyam Pillai said:
There is no VBA method to open a presentation protected with a password in
PowerPoint 2002/2003 nor is there a way to determine if the presentation is
password protected. However, if you know the password to a presentation,
then you can try and modify the following workaround if it suits you.

1. Open the main presentation and switch to Visual Basic Editor (Alt + F11)
2. Insert a code module into the VBA project.
3. Copy and paste the following snippet.
' ----------snippet -------
Option Explicit
Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Public TimerID As Long
Public sPwd As String


Sub OpenPassPres()
Dim oPres As Presentation
TimerID = SetTimer(0, 0, 2000, AddressOf PassProc)
' Replace with your password
sPwd = "shyam"
' Replace E:\PresPass.ppt with your path to presentation
Call Presentations.Open("E:\prespas­s.ppt")
End Sub


Sub PassProc(ByVal hwnd As Long, _
ByVal uMsg As Long, _
ByVal idEvent As Long, _
ByVal dwTime As Long)
TimerID = KillTimer(0, TimerID)
SendKeys sPwd & "~"
End Sub
' --------End of Snippet ----
4. Run the macro - OpenPassPres.


You will notice the Password window momentarily and then the password will
be transmitted and the presentation will open.
 
When you try to open a password protected presentation. If will not fail, it
will simply prompt for the password and wait till the dialog is closed.


--
Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm

Stretchcoder said:
WHOA -
Is there really no way to determine if a presentation is password
protected? I was thinking I would try and open the presentation, and read
the
error code to see why I can't open it... would this work?
 
Back
Top