' ---------------------------------------------------------------------- ' Useful document(s) ' ' Interactive Communication API Reference iac_api_reference.pdf ' http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/iac_api_reference.pdf ' From Wikipedia ' PDF currently supports two different methods for integrating data and PDF forms. ' Both formats today coexist in PDF specification:[1][5] ' AcroForms (also known as Acrobat forms), introduced and included in the PDF 1.2 format specification. ' Adobe XML Forms Architecture (XFA)forms, introduced in the PDF 1.5 format specification as an optional feature ' (The XFA specification is not included in the PDF specification, it is only referenced.) ' Adobe XFA Forms are notcompatible with AcroForms. ' Creating XFA Forms for use in Adobe Reader requires Adobe LiveCycle Forms Designer ' ---------------------------------------------------------------------- ' this script is focussed on AcroForms ' That is to say I have access to ADOBE ACROBAT X STANDARD ' and this script worked. ' ---------------------------------------------------------------------- newscript ' ---------------------------------------------------------------------- ' dim ado = CreateObject("AcroExch.App") ado.show ' Acrobat Viewer (AV) layer deals with the viewer’s user interface ' Portable Document (PD) layer provides access to components of PDF documents dim PDDoc = CreateObject("AcroExch.PDDoc") ' Link to the PDF to be edited dim myDoc = PDDoc .open ( "replace this by the full path/file name of PDF file to be edited") ' Create a window to display the document in, and give the window a title dim myWin = PDDoc .openAVdoc ("Form to Fill") dim AFORMAUT = CreateObject("AFormAut.App") dim FormFields = AFORMAUT.Fields ' ---------------------------------------------------------------------- ' This is just to show us the names of the editable fields ' It looks as if you can only access a FIELD by it's name, there does NOT seem to a numeric key! ' display the names of the input fields in a pop-up message dim field Dim FieldNames as String FieldNames = "" For Each field In FormFields FieldNames = FieldNames & field.Name & chr (0x0a) ' VBA would use vbcrlf not chr (0x0a) Next field message = FieldNames ' ---------------------------------------------------------------------- ' Here are examples of filling in editable fields ' CASE sensitive ! FormFields.item ("IBAN").value = "1234" ' Checkboxes ' is language sensitive FormFields.item ("Herr").value = "On" ' ---------------------------------------------------------------------- ' now save the edited document Constant PDSaveFull = 1 Constant PDSaveBinaryOK = 16 ' ( &H10) Constant PDSaveCollectGarbage = 32 ' (&H20) Constant PDSaveCopy = 2 Constant PDSaveIncremental = 0 Constant PDSaveLinearized = 4 Constant PDSaveWithPSHeader = 8 ' save a COPY of the current document PDDoc.save ( PDSaveFull + PDSaveCopy , "replace this by the full path/file name of the editied PDF" ) ' Finished