|
-
May 11th, 2012, 09:57 AM
#1
Thread Starter
New Member
"Password to Modify" causes Prompt
Hi,
I'm using VB6 to open a powerpoint file, but a dialog box opens up that says "file.pptx is reserved by x. Enter password to modify, or open read only."
This is causing my program to wait for input. I'd like to be able to do one of the following:
- Detect that the file has such a restriction
- Open the file in such a way that the prompt doesn't appear
(I tried opening the file as read only, but that doesn't work)
- Issue a response programatically
(Tried using sendkeys with a Timer, but the timer sub never
got called).
Any help is appreciated.
Thanks
-
May 11th, 2012, 11:19 AM
#2
Re: "Password to Modify" causes Prompt
The way I see it:
- file was protected for a reason;
- any attempt to break security may compromise its content;
- any suggestion on how to do this may violate this forum's rules.
Sorry for not being much helpfull.
-
May 11th, 2012, 11:30 AM
#3
Thread Starter
New Member
Re: "Password to Modify" causes Prompt
Well, there is not any security violation going on here. The "Read-only" option just says that the file cannot be modified - I'm not trying to modify it, just read it. Besides that, I'd be just as happy to know if the file was marked "Read-only".
Users are adding this restriction to their ppt file, then sending it to my program for processing, they want me to open their file. I'm just trying to work around it, as the end user is not aware it will cause a problem for me.
-
May 11th, 2012, 01:45 PM
#4
Re: "Password to Modify" causes Prompt
Instead of attempting to "break" password protected files meet with the end users to come up with a workflow solution that works for everybody.
-
May 11th, 2012, 02:07 PM
#5
Re: "Password to Modify" causes Prompt
There is nothing untoward going on here, Mopp just wants to pick one of the options on the dialog by default, rather than displaying the dialog.
Unfortunately I don't know how to do that, but if you show the code you are currently using, others are likely to find it easier to help.
-
May 14th, 2012, 09:05 AM
#6
Thread Starter
New Member
Re: "Password to Modify" causes Prompt
My current solution is to have my main program call another smaller program whose sole job is to open, then close the given PowerPoint file. If the main program does not hear from the smaller program after a while (maybe 1 minute), assume that the file is read-only. Don't really like it, but don't know what else to to.
-
May 14th, 2012, 09:58 AM
#7
Fanatic Member
Re: "Password to Modify" causes Prompt
My understanding is that MOPP does not want to crack any security. He simply wants to prevent his application from hanging/locking up while waiting for the user to enter credentials into the PPT.
A perfectly legal and reasonable request.
In a multithreaded environment then firing a secondary thread to do the hanging waiting would solve the problem. Threads in VB6 is possible but I'd suggest your own solution of spawning a smaller program to do the job is just fine.
-
May 14th, 2012, 02:49 PM
#8
Re: "Password to Modify" causes Prompt
Are you just trying to Show the presentation?
Code:
Private Sub cmdShowIt_Click()
With New Shell32.Shell
With .NameSpace(ssfDESKTOP).ParseName(App.Path & "\Sample.ppt")
.InvokeVerb "Show"
End With
End With
End Sub
-
May 14th, 2012, 03:03 PM
#9
Thread Starter
New Member
Re: "Password to Modify" causes Prompt
Not trying to "Show" it, just trying to open it with something like this:
Set oPres = m_oApp.Presentations.Open(pptFile)
If the file is set to read-only, a dialog box prompt appears and the calling program becomes unresponsive until the dialog is clicked.
-
May 14th, 2012, 03:58 PM
#10
Re: "Password to Modify" causes Prompt
Yes, if you use Automation I think the dialog is always raised even if you use ReadOnly:=True in the parameter list.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|