Copy link to clipboard
Copied
I currently use the following VBA code in my local Microsoft Acess database to fill local adobe forms and manually send them to clients for e-signature. I would prefer to be use templates https://acrobat.adobe.com/ but I am not sure how I need to do this. Here is my VBA code in MS Access:
"Private Sub Command80_Click()
' Set the path to your PDF file
Dim pdfPath As String
pdfPath = "C:\Users\Owner\Desktop\ssa1696.pdf"
' Create an AcroExch application object
Dim App As Object
Set App = CreateObject("Acroexch.app")
' Open the PDF from the specified path
App.Show
App.OpenDoc (pdfPath)
' Wait for the document to load
Do While App.GetActiveDoc Is Nothing
DoEvents
Loop
' Get the active AVDoc
Dim AVDoc As Object
Set AVDoc = App.GetActiveDoc
' Get the PDDoc
Dim PDDoc As Object
Set PDDoc = AVDoc.GetPDDoc
' Get the JSObject
Dim jso As Object
Set jso = PDDoc.GetJSObject
' Clear the form
Dim temp As Variant
temp = jso.resetForm
' Populate form fields
SetField jso, "ClientSSN", Format(Me.SSN.Value, "000-00-0000")
SetField jso, "ClientFirstName", Me.FirstName.Value
SetField jso, "ClientLastName", Me.LastName.Value
SetField jso, "ClientMailingAddr1", Me.MailingAddr1.Value
SetField jso, "ClientMailingAddr2", Me.MailingAddr2.Value
SetField jso, "ClientMailingAddrCity", Me.City.Value
SetField jso, "ClientMailingAddrState", Me.State.Value
SetField jso, "ClientMailingAddrZip", Me.Zip.Value
SetField jso, "ClientPhone", Format(strClientPhone, "000-000-0000")
' Housekeeping on the way out
App.Exit
Set App = Nothing
End Sub"
Have something to add?