Results 1 to 2 of 2

Thread: Opening password protected Word Document in OLE Container

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    2

    Opening password protected Word Document in OLE Container

    I have a VB6 Application using a form with an OLE Container.

    A document is opened like:

    ole1.CreateEmbed "C:\Test.doc"

    This works fine, but when the document C:\test.doc is password protected, a password-entry box appears. I want the application to open the document automatically without interaction with the user.

    Is it possible to pass the password to the document by passing it as a parameter or something like that, like the PasswordDocument property.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Opening password protected Word Document in OLE Container

    you may need to remove the document password first then reapply after opening in OLE or before closing your app
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

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