How to Print Password-Protected PDFs to New Files Using VBA
Question details
The user needs to automate a Microsoft Access VBA process to open password-protected PDFs and print them as unprotected files for coworkers lacking credentials.

- Product
- Microsoft Access, Adobe PDF
- Device & OS
- not provided
- Scenario
- Automating the removal of PDF passwords via a VBA script to distribute restricted documents to unauthorized coworkers.
- Observed behavior
- The user seeks a method to pass credentials to a PDF via VBA and use a virtual printer to generate a new file, while navigating potential authentication roadblocks.
Before attempting to remove passwords or modify PDF permissions, ensure you have explicit authorization from the document owner to unlock and distribute the restricted content.
Automate PDF Printing Using Adobe Acrobat VBA References
Use Adobe Acrobat's OLE automation in MS Access to programmatically open the protected PDF and print it to a new file, provided you have the required passwords.
To accomplish this, your VBA script must interact with a PDF handler capable of passing a password. Standard PDF virtual printers cannot bypass internal passwords or external website logins on their own.
If you are authorized, you can leverage the Adobe Acrobat library within Access VBA to open the file and re-print it to strip the security settings.
Determine whether the PDF uses a standard internal open/permissions password or requires external web authentication. VBA cannot natively bypass external web portal logins.
In your MS Access VBA editor, navigate to 'Tools' > 'References' from the top menu and check the box for the 'Adobe Acrobat' or 'Acrobat Distiller' object library.
Use the 'AcroExch.App' and 'AcroExch.AVDoc' objects in your VBA script to open the PDF programmatically, passing the required document password as an argument during the open method.
Invoke the print command within your VBA script to send the opened document to a virtual PDF printer, saving it automatically as a new, unprotected PDF file.

Remove PDF Passwords and Share Seamlessly with WPS Office
Instead of relying on complex VBA scripts and Acrobat automation, you can use WPS Office's built-in PDF tools to quickly remove passwords from authorized files. This allows you to easily save unprotected versions and share them with your coworkers.
- 1. Open the Protected PDF: Launch WPS Office and open the password-protected PDF by entering the valid open password when prompted.
- 2. Access the Protect Menu: Navigate to the 'Protect' tab located on the top ribbon of the WPS PDF editor.
- 3. Modify Encryption Settings: Click on 'Encrypt' to open the security settings window and uncheck the 'Set Open Password' or permission constraints.
- 4. Save the Unprotected File: Confirm the security changes and go to 'File' > 'Save As' to export the document as a new, unprotected PDF file for your coworkers.

Frequently Asked Questions
Why can't my VBA script bypass external website PDF logins?
External website authentications are controlled by web portals or third-party DRM systems, not the PDF file itself. A standard VBA script or virtual PDF printer cannot natively interact with or bypass these secure web-based prompts.
Is it legal to use VBA to remove PDF passwords?
It is only legal and acceptable if you are the document owner or have explicit authorization to remove the security restrictions. Bypassing protection to share files with unauthorized users may violate company policies or copyright laws.
Can I remove PDF passwords in MS Access without Adobe Acrobat installed?
No, MS Access does not have native capabilities to decrypt and remove passwords from PDFs. You must integrate a third-party PDF library, command-line tool, or API into your VBA code to handle the decryption process.




