Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. ' github.com/marksduarte
  2. '
  3. ' The Adobe Acrobat 10.0 [or anyone version] Type Library
  4. ' is needed to the project.
  5. '
  6. Sub AdobeFill_Click()
  7. Dim objAVDoc As New AcroAVDoc
  8. Dim objPDDoc As New AcroPDDoc
  9. Dim objJso
  10. Dim strFilename As String: strFilename = "C:\Temp\file.pdf"
  11.  
  12. If (objAVDoc.Open(strFilename, "")) Then
  13. Set objPDDoc = objAVDoc.GetPDDoc
  14. Set objJso = objPDDoc.GetJSObject
  15.  
  16. With objJso
  17. .getField("name").Value = "Marks Duarte"
  18. .getField("date").Value = Format(Date, "dd.mm.yyyy")
  19. End With
  20.  
  21. If objPDDoc.Save(PDSaveIncremental, strFilename) Then
  22. objAVDoc.Close 1
  23.  
  24. objAVDoc = Nothing
  25. objPDDoc = Nothing
  26. objJso = Nothing
  27. End If
  28. End If
  29. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement