• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Opening password protected pdf on Word using Excel vba

nmr4u

New Member
I am trying to open a password protected pdf on MS Word using Excel VBA but it shows me the Password screen for me to enter the password, though I have provided the PasswordDocument parameter. In case the PDF is not password protected, I am able to open it without a problem.

Code used:
Code:
Set oDoc = objWord.Documents.Open( _
Filename:=strFilePath & strFileName, _
PasswordDocument:="@", ReadOnly:=True)

In the above code, strFilePath contains the folder location (example: c:\) and strFileName contains the file name (example: 1.pdf).
 

Attachments

  • 1.jpg
    1.jpg
    12.2 KB · Views: 12
Back
Top