I am brand new to Acrobat. If this is not the right community please let me know.
I have an Access 2010 application that has to fill in a fillable PDF form. I have Acrobat Pro 9.0 Extended. I've referenced the Acrobat Type library in my application. I am using VBA.
I am looping over an array which contains the PDF field names and the values to insert. I pulled the field names off the PDF using JSObject, so I know they're correct. The problem is that the values are not being inserted.
My code:
Dim acrobatApp As Acrobat.CAcroApp
Dim PDDoc As Acrobat.CAcroPDDoc
Dim jso As Object
Set acrobatApp = CreateObject("AcroExch.App")
Set PDDoc = CreateObject("AcroExch.PDDoc")
PDDoc.Open(FilePath)
Set jso = PDDoc.GetJSObject
For n = 0 To numFields - 1
jso.getfield(arFldNames(n)).Value = arValues(n) 'WHY ISN'T THIS INSERTING?
Debug.Print "Set field " + arFldNames(n) + " = " + arValues(n)
Debug.Print "jso.GetField(" & arFldNames(n) & ") " & " = " & jso.getfield(arFldNames(n)).Value
Next n
Debug Output:
Set field us-ids[0].sfpatitemflow[0].patItemsf[0].patnumbertxt[0] = 123 '[123 is the value that should be inserted]
jso.GetField(us-ids[0].sfpatitemflow[0].patItemsf[0].patnumbertxt[0]) = '[null] is the value that was inserted. WHY?