manmoncang Posted February 11, 2007 Share Posted February 11, 2007 I use code below to open pdf file that has password using adobe reader 7. It's working well. But IT'S NOT WORKING IN ADOBE READER 8. Anybody here can help me to open pdf file that has a password for all version of adobe reader?Your help is needed. Tq so much.Opt("WinWaitDelay", 10)$filepdf = "C:\exampleProtectedFile.pdf"Run(@ComSpec & " /c Start " & FileGetShortName($filepdf), "", @SW_HIDE);Look for the password popup window$winTitle = "Password"$winText = "Please enter a Document Open Password."WinWait($winTitle, $winText, 5);five second timeout so that script doesn't hang....If @error Then Exit ControlSetText($winTitle,"","Edit1","password")ControlClick($winTitle, $winText,"OK") Link to comment Share on other sites More sharing options...
Zedna Posted February 11, 2007 Share Posted February 11, 2007 Be more specific where is problem. Dialog for password is differrent? Edit1 in version 7 may be differrent in version 8. Suggestions: - try WinWaitActive() instead WinWait() - try Send() instead ControlSend() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
manmoncang Posted March 9, 2007 Author Share Posted March 9, 2007 Be more specific where is problem.Dialog for password is differrent? Edit1 in version 7 may be differrent in version 8.Suggestions:- try WinWaitActive() instead WinWait()- try Send() instead ControlSend()Below is my function to open file pdf that has password using Adobe 7. But it's fail when i using Adobe 8$filepdf = "filename.pdf"$file = FileOpen($filepdf, 0) If $file = -1 Then MsgBox(0, "Error", "File Was Not Found.") Exit Else Opt("WinWaitDelay", 20) Run(@ComSpec & " /c Start " & FileGetShortName($filepdf), "", @SW_HIDE) ;Look for the password popup window $winTitle = "Password" $winText = "Please enter a Document Open Password." WinWaitActive($winTitle, $winText, 9);five second timeout so that script doesn't hang.... If @error Then Exit ; ControlSetText($winTitle,"","Edit1","PDF PASSWORD ENTER HERE") ControlClick($winTitle, $winText,"OK") EndIfPlease help me to fix this problem. TQVM Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now