Automating XFA PDF forms from Access VBA
Copy link to clipboard
Copied
Hello,
I've been working on automating filling in fields on PDF forms using Access VBA. I reference directly the Adobe libraries in VBA to skip having to use "CreateObject", but otherwise have been adapting online examples with a good degree of success.
The problem I've encountered, however, is the inability to access the rawValue property of an empty field. That is, if I open a blank XFA form, I can access the field, but VBA returns "Object doesn't support this property or method", meaning it can reslve the field node, but cannot access the "rawValue" property.
If I populate the field in Adobe, then re-run the script, it runs without issue. Obviously a null / unpopulated field in a form is not fully initialized / exposed to the object model from within VBA. Is there a workaround I can do in the VBA side? I could save a version of the form with dummy values to sidestep the issue, but the form updates out of my control, which means I'd have to do that every time a an update occurs. I'd rather be able to download the latest current version and populate that.
Have something to add?

