View Full Version : [SOLVED:] Populate PDF Form via VBA
Hello,
I have created a PDF form via Adobe Acrobat Pro 8.0. Please is there any solution to populate the text fields in the Adobe form via VBA?
Thanks
stanl
08-13-2008, 04:49 AM
I have 7.0, but assuming your VBA code does something like (where cPDF is your document)
AcroApp = CreateObject("AcroExch.App")
AvDoc = CreateObject("AcroExch.AVDoc")
PDDoc = CreateObject("AcroExch.PDDoc")
If AvDoc.Open cPDF,"" Then 'pdf document is open
then to fill in form data, something like
AcroForm = CreateObject("AFormAut.App")
Fields = AcroForm.Fields
For Each f in Fields
If f.type="Text" Then Fields.Item(f).Value = "something"
Next f
If your form has radio buttons, other types of controls or you need fields marked as readonly after data is entered, it gets more complicated, so you might want to post a copy of the pdf. .02 Stan
Thanks very much, I tried the instructions that you have provided and it is perfect, the data are easily transmitted from access table to PDF form in no time.
Also look into using fdf data files, they can make life MUCH easier for complicated PDF forms.
http://www.adobe.com/devnet/acrobat/fdftoolkit.html
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.