PDF Editing Issues

How to Read PDF Form Fields Using Microsoft Access VBA

Elise WilliamsElise Williams Nov 3, 2026 868 views

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.

How to Read PDF Form Fields from 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.
Before you start

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.

Solution 1Recommended

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.

1
Reference the Acrobat Library

In your Microsoft Access VBA Editor, navigate to Tools > References and enable the 'Acrobat' type library to allow VBA to communicate with PDF files.

2
Initialize the Acrobat Application

Write VBA code to declare and set the Acrobat Application, AVDoc, and PDDoc objects, then use them to open your target PDF document.

3
Instantiate the JavaScript Object

Call the 'GetJSObject' method on your PDDoc object. This creates a bridge that allows you to execute Acrobat JavaScript commands directly from VBA.

4
Extract List Box Values

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.

Use Acrobat JavaScript Object in VBA
Testing Recommendation: Always test your VBA code with both single-selection and multiple-selection list boxes to ensure your JavaScript object handles arrays correctly.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the WPS Office website to download the free installer for your operating system.
  2. 2. Install the Suite: Run the setup file and follow the simple on-screen instructions to complete the installation.
  3. 3. Open Your Documents: Launch WPS Office to immediately begin reading PDFs and editing your Office-compatible files.
Fully compatible with Microsoft Excel, Word, and PowerPoint formatsBuilt-in, user-friendly PDF editor for viewing and filling forms directlyLightweight design ensuring fast performance on any desktopSeamlessly transition your existing workflow with an intuitive interface
microsoft office alternative - wps office

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.