1

I've got to grips with using VBA to fill in PDF forms...

Dim acroAppObj As Acrobat.AcroApp : Set acroAppObj = CreateObject("AcroExch.App")
Dim acroADocObj As Acrobat.AcroAVDoc : Set acroADocObj = CreateObject("AcroExch.AVDoc")

If Not acroADocObj.Open(lPDFFormFileName, "") Then Exit Sub
acroAppObj.Show 
Dim acroFormObj As AFORMAUTLib.AFormApp  Set acroFormObj = CreateObject("AFormAut.App")

acroFormObj.Fields("First Field).Value = "First Value"
'..... populate all the fields in the form ...
acroFormObj.Fields("Last Field).Value = "Last Value"  

acroADocObj.Close (True)
acroAppObj.CloseAllDocs
acroAppObj.Exit
acroAppObj.Hide

Set acroFormObj = Nothing
Set acroPDocObj = Nothing 
Set acroADocObj = Nothing 
Set acroAppObj = Nothing 

and this uses a window independent of the excel userform.

Is it possible to embed the instance of Acrobat.AcroApp into an excel userform ?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • It should be possible to add the Acrobat document as a reference to your toolbox (early binding). Then it should be possible to drag the control from the toolbox to your form – xmojmr Aug 27 '18 at 12:18
  • 1
    The "Adobe Acrobat 10.0 Type Library" is available in the References but I do not see it in the Additional Controls of the UserForm ? – Arran Pritchard Aug 27 '18 at 22:53
  • Anybody know if it is possible to use AcroApp API in an excel userform ? – Arran Pritchard Aug 29 '18 at 03:33
  • 1
    I think the way to do this is to put the pdf fields on the excel userform and fill them in there, then use acrobat.acroexch to populate the pdf. – Arran Pritchard Sep 03 '18 at 06:43

0 Answers0