How to Read PDF Form Fields Using Microsoft Access VBA
Question details
The user needs to extract names, types, and values from PDF form fields (specifically list boxes) into a database using Microsoft Access VBA.

- Product
- Adobe Acrobat / Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating the extraction of PDF form field data into a Microsoft Access database.
- Observed behavior
- List boxes require special handling because distinguishing between single-selection and multiple-selection values fails when using generic VBA property calls.
Ensure you have the full version of Adobe Acrobat installed, as Acrobat Reader does not support the OLE automation required for VBA, and verify that the target PDF contains interactive form fields.
Use Acrobat JavaScript Object in VBA
Utilize Acrobat's JavaScript interface to securely access specific list-box properties and selection values.
When reading PDF form fields from Access VBA, generic calls like 'Value' or 'numItems' often fail with list boxes because their available properties vary depending on whether they are set to single-selection or multiple-selection mode.
By instantiating an Acrobat JavaScript object (GetJSObject) within your VBA code, you can bridge the gap and interact with complex PDF form elements natively.
In your Microsoft Access VBA Editor, navigate to Tools > References and enable the 'Acrobat' type library to allow VBA to communicate with PDF files.
Write VBA code to declare and set the Acrobat Application, AVDoc, and PDDoc objects, then use them to open your target PDF document.
Call the 'GetJSObject' method on your PDDoc object. This creates a bridge that allows you to execute Acrobat JavaScript commands directly from VBA.
Use the JavaScript object to access the specific form field. Verify its selection mode (single vs. multiple) and retrieve the selected values or indices accordingly before passing them back to your Access database.

A Reliable Alternative for Managing Office and PDF Files
While Microsoft Access VBA handles complex database integrations and Acrobat manages PDF APIs, you might be looking for a seamless, everyday office suite. WPS Office is a highly compatible, free alternative that natively handles your essential documents and PDF needs without hefty subscription fees.
- 1. Download WPS Office: Visit the WPS Office website to download the free installer for your operating system.
- 2. Install the Suite: Run the setup file and follow the simple on-screen instructions to complete the installation.
- 3. Open Your Documents: Launch WPS Office to immediately begin reading PDFs and editing your Office-compatible files.

Frequently Asked Questions
Can I use generic VBA calls to read multiple-selection list boxes in a PDF?
No, relying on generic calls like 'Value', 'numItems', or 'currentValueIndices' is unreliable because list-box properties vary by selection mode. You should use a JavaScript object via Acrobat to access the correct properties.
What object do I need to create in Access VBA to run PDF JavaScript?
You need to create a JSObject by calling the 'GetJSObject' method on an active Acrobat PDDoc object in your VBA code. This exposes the Acrobat JavaScript API to VBA.
Is Acrobat Reader sufficient to extract PDF form fields using VBA?
No. The 'GetJSObject' method and the Acrobat OLE automation required to read form fields programmatically from VBA require the full Adobe Acrobat Standard or Pro version installed on your device.




