Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. Dim strTemplate, strPath, strDir, gApp, avDoc, pdDoc, jso
  2.  
  3. strPath = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, ""))
  4. strDir = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, ""))
  5. strDir = strDir & "Plans" & Form_Plan_Frm!Cage & "" & Form_Plan_Frm!UID
  6. strTemplate = strPath & "Templatestest.pdf"
  7.  
  8. Set gApp = CreateObject("AcroExch.app")
  9.  
  10. Set avDoc = CreateObject("AcroExch.AVDoc")
  11. If avDoc.Open(strTemplate, "") Then
  12. Set pdDoc = avDoc.GetPDDoc()
  13. Set jso = pdDoc.GetJSObject
  14.  
  15. jso.getField("Form1[0].Pg1[0].fieldName[0].TopInfo(0).UIDName(0)").Value = "37555-20170517-00001-00023"
  16. pdDoc.Save PDSaveIncremental, "Test.pdf" 'Save changes to the PDF document
  17. pdDoc.Close
  18. End If
  19.  
  20. avDoc.Close (True)
  21.  
  22. Set gApp = Nothing
  23. Set avDoc = Nothing
  24. Set pdDoc = Nothing
  25. Set jso = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement