Results 1 to 10 of 10

Thread: "Password to Modify" causes Prompt

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    4

    "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

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    4

    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.

  4. #4

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    4

    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.

  7. #7
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    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.

  8. #8
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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

  9. #9

    Thread Starter
    New Member
    Join Date
    May 2012
    Posts
    4

    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.

  10. #10
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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
  •  



Click Here to Expand Forum to Full Width