How to open Password Protected PPT File

M

miztaken

Hi there,
I dont know if this the right forum to ask this question or not? If
not, please guide me through.
If yes,
I need to supply password to PPT file progrmatically.
I am using Office Interop and .NET 2.0 (C#)
I am coding like this:
ApplicationClass appPowerPoint = new ApplicationClass();
Presentation presentation =
appPowerPoint.Presentations.Open(FileName,
Microsoft.Office.Core.MsoTriState.msoCTrue,
Microsoft.Office.Core.MsoTriState.msoCTrue,
Microsoft.Office.Core.MsoTriState.msoCTrue);
As you can see Presentations.Open dont have any argument where i can
input password.
For word and excel password input argument is available but i cant
find that for PPT.
I do know there is presentation.Password variable, but we can use
this
only after PPT is opened?
So can anybody help me figure out what am i missing?
Thank You
miztaken
 
S

Steve Rindsberg

Hi there,
I dont know if this the right forum to ask this question or not? If
not, please guide me through.
If yes,
I need to supply password to PPT file progrmatically.
I am using Office Interop and .NET 2.0 (C#)
I am coding like this:
ApplicationClass appPowerPoint = new ApplicationClass();
Presentation presentation =
appPowerPoint.Presentations.Open(FileName,
Microsoft.Office.Core.MsoTriState.msoCTrue,
Microsoft.Office.Core.MsoTriState.msoCTrue,
Microsoft.Office.Core.MsoTriState.msoCTrue);
As you can see Presentations.Open dont have any argument where i can
input password.
For word and excel password input argument is available but i cant
find that for PPT.
I do know there is presentation.Password variable, but we can use
this
only after PPT is opened?
So can anybody help me figure out what am i missing?

Nothing. MS hasn't exposed any methods for opening password protected files in
PPT. As a hack/workaround, you could work out the name of the dialog box that
appears when you open a protected file, then send keystrokes to it to feed it
the password.
 
D

Danilo

I have the same problem.....
Even with the workaround the problem remains because in that moment I
don't have the control of the application, but PP has....
So my code won't be executed until the operator will press the "OK" or the
"Cancel"
button, only in that moment I get again the control of the application and I
can
use the sendkey function......

The only way I see is to create another program that waits for the PP
messagebox
the be shown and then work on it, but it's terribly ugly ........

cheers
__Danilo
 
S

Steve Rindsberg

I have the same problem.....
Even with the workaround the problem remains because in that moment I
don't have the control of the application, but PP has....
So my code won't be executed until the operator will press the "OK" or the
"Cancel"
button, only in that moment I get again the control of the application and I
can
use the sendkey function......

The only way I see is to create another program that waits for the PP
messagebox
the be shown and then work on it, but it's terribly ugly ........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top