0 Replies Latest reply on Sep 9, 2014 4:27 PM by aufer

    easy way to fill an XFA form using Excel VBA ?

    aufer

      All:

      Need help to auto-fill and auto-save PDFs using VBA or some other means.

       

      I have created an XFA form using LiveCycle ES ( v8 ) with a few fields.

      What I need to do is

      1. Open the blank PDF form
      2. Update 3 fields
      3. Save the PDF with a new name

       

      My Excel VBA code so far ( ** Copied from another post ).

       

      Sub rxOpenPDF_UpdateFields()

          Dim pdfApp As Acrobat.AcroApp, pdfPDDoc As Acrobat.AcroPDDoc, jso As Object

          Dim str1$, bolOpen As Boolean, strFile$

         

          Set pdfApp = CreateObject("AcroExch.App")

          Set pdfPDDoc = CreateObject("AcroExch.PDDoc")

          bolOpen = pdfPDDoc.Open("C:\test.PDF")

       

          Set jso = pdfPDDoc.GetJSObject

          str1 = jso.getfield("Account_Name").Value

          pdfApp.Exit

          Set pdfApp = Nothing

          Set pdfPDDoc = nothing

          Set jso = Nothing

         

      End Sub

       

      Excel is exiting ( cannot recover ) on the pdfPDDoc.Open statement

      Any help will be very appreciated


      Aubrey

       

      I am on Windows XP,

      In VBA, I have created Tool References to [Adobe Acrobat 9.0 Type Library]

      Downloaded the Acrobat v9 SDK but was lost trying to locate any help for simple VBA.