The FindWindow API function is used to find the pop-up window that prompts the user to fill the password.Then, the ShellExecute API is used to open the file using the associated default program (either Adobe Reader or Adobe Professional). First of all, the code checks if the given path is valid (e.g.The main idea behind the code below can be divided into four steps: It just automates the opening procedure, especially if you have to open multiple PDF files. Note: the VBA code that you will see below is NOT a password cracking piece of code! The code implies that you know the password of the file. The answer is, yes! The suggested solution relies on several Windows APIs since the Adobe Object Model does not provide an option/method for including the password when opening a PDF file. There is a problem, though: what will happen if the PDF file you want to open is password-protected? Is there a way to fill the password in the open dialog and continue opening the file? Both ways worked and continue to work just fine. The second one was more generic it was taking advantage of the Windows API functions and it could be used by both Adobe Reader and Professional. In the past, we have seen two ways to open PDF files with VBA: the first one involved the usage of the Adobe Object Model and it could be only used with Adobe Professional.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |