I need to open a password-protected PowerPoint 2007 presentation from a VSTO in C#. I tried OpenPPT using VBA and it seems to work.
As I need to use C# I tried this code:
?
[DllImport("openppt.dll", EntryPoint = "OpenPresentation")]
public static extern Presentation OpenPresentation(Application PowerPoint, string FileName, string Password, bool ReadOnly, bool Untitled, bool WithWindow);
?
Presentation Pres = OpenPresentation(_application, @"C:\temp\pass1.pptx", "MyPassword",
false, false,
true);
This throws an exception.
1. What am I doing wrong?
2. How are you doing this in OpenPPT, are you injecting keytrokes or using some safer method?
Thank you,
Arie
Chirag wrote:
Is 123 the password to open prespass.ppt?
03-Jun-10
Is 123 the password to open prespass.ppt? If yes and you are still gettin
this error, can you please email me your prespass.ppt to help me analyze th
issue? Which PowerPoint version are you using
- Chirag
Previous Posts In This Thread:
How tp open a password protected powerpoint file by Excel macro
How to open a password protected powerpoint file by Excel macro? by th
way,the cipher is known
Is it possible to do this
Thanks in advance,
How is this related to PowerPoint?
How is this related to PowerPoint?
Are you asking about an Excel file that is linked to a PowerPointpresentation?
Are you asking about an Excel file that is linked to a PowerPoin
presentation? This is the PowerPoint group, and I am trying to figure out th
connection between your Excel question and PowerPoint
-
Echo [MS PPT MVP]
http://www.echosvoice.co
What's new in PPT 2010?
http://www.echosvoice.com/2010.ht
Fixing PowerPoint Annoyances
http://tinyurl.com/36grc
PowerPoint 2007 Complete Makeover Kit
http://tinyurl.com/32a7nx
As far as I know in PowerPoint there is no method of opening a
As far as I know in PowerPoint there is no method of opening a passwor
protected file using vba from Excel (or even in directly PowerPoint vba
Unlike in Excel you cannot specify the password as an argument
-
john ATSIGN PPTAlchemy.co.u
Free PPT Hints, Tips and Tutorial
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.htm
:
PowerPoint does not natively provide a way to open
PowerPoint does not natively provide a way to open password-protecte
presentations. You might want to look at my free openppt.dll that allows yo
to supply a password to open a password protected presentation. To use i
from Excel, you would have to create an instance of PowerPoint usin
CreateObject() and pass the instance as the first parameter to th
OpenPresentation() function
More information on openppt.dll is available a
http://officeone.mvps.org/openppt
- Chira
PowerShow - View multiple PowerPoint slide shows simultaneousl
http://officeone.mvps.org/powershow/powershow.html
I am doing as follows:1.Place the openppt.
I am doing as follows
1.Place the openppt.dll in the Windows folder (C:\Windows)
2.plug-in a new modul
3.write code in new module
'--------------------------------------------
Sub Test(
Dim Pres As Presentatio
Set Pres = OpenPresentation(Application,
"d:\prespass.ppt", "123",
False, False, True
End Su
'----------------------------------------------
Error: Run-time Error'424' Object Require
How I am going to do
Thank you
Is 123 the password to open prespass.ppt?
Is 123 the password to open prespass.ppt? If yes and you are still gettin
this error, can you please email me your prespass.ppt to help me analyze th
issue? Which PowerPoint version are you using
- Chirag
You need to add the import declaration at the top of your module, aboveyour
You need to add the import declaration at the top of your module, above
your Sub:
Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant
ChiragMy PowerPoint version is 2003I want to E-mail the prespass.ppt to you.
Chirag
My PowerPoint version is 2003
I want to E-mail the prespass.ppt to you.
Can you give me your valid E-mail.
-juwen
:
You can send me an email at the id listed at the bottom of the same webpage.
You can send me an email at the id listed at the bottom of the same web
page.
- Chirag
Yes,I added the import declaration at the top of your module,which I forgotto
Yes,I added the import declaration at the top of your module,which I forgot
to write
I am doing as follows:
1.Place the openppt.dll in the Windows folder (C:\Windows).
2.plug-in a new module
3.write code in new module:
'--------------------------------------------------------------------
Public Declare Function OpenPresentation Lib "openppt.dll" ( _
ByVal PowerPoint As Variant, _
ByVal FileName As String, _
ByVal Password As String, _
ByVal ReadOnly As Boolean, _
ByVal Untitled As Boolean, _
ByVal WithWindow As Boolean) As Variant
Sub Test()
Dim Pres As Presentation
Set Pres = OpenPresentation(Application, _
"d:\prespass.ppt", "123", _
False, False, True)
End Sub
'-----------------------------------------------------------------------
Error: Run-time Error'424' Object Required
Submitted via EggHeadCafe - Software Developer Portal of Choice
Changing WCF Service Implementation at Runtime
http://www.eggheadcafe.com/tutorial...ng-wcf-service-implementation-at-runtime.aspx