Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim strTemplate, strPath, strDir, gApp, avDoc, pdDoc, jso
- strPath = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, ""))
- strDir = Left(CurrentDb.Name, InStrRev(CurrentDb.Name, ""))
- strDir = strDir & "Plans" & Form_Plan_Frm!Cage & "" & Form_Plan_Frm!UID
- strTemplate = strPath & "Templatestest.pdf"
- Set gApp = CreateObject("AcroExch.app")
- Set avDoc = CreateObject("AcroExch.AVDoc")
- If avDoc.Open(strTemplate, "") Then
- Set pdDoc = avDoc.GetPDDoc()
- Set jso = pdDoc.GetJSObject
- jso.getField("Form1[0].Pg1[0].fieldName[0].TopInfo(0).UIDName(0)").Value = "37555-20170517-00001-00023"
- pdDoc.Save PDSaveIncremental, "Test.pdf" 'Save changes to the PDF document
- pdDoc.Close
- End If
- avDoc.Close (True)
- Set gApp = Nothing
- Set avDoc = Nothing
- Set pdDoc = Nothing
- Set jso = Nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement