My question is: How am I able to access an embedded PDF through VBA, so that I may use the following code (working):
As you can see, the code above accesses a PDF file that was created using Acrobat. It opens the pdf in acrobat, which is perfect for me. It then populates fields in the PDF using information in the database.
I need to be able to embed the PDF within a table, have it open in a new acrobat window as read-only so that a user can make final edits and save it to their desktop or wherever.
I have no idea how VBA accesses files that are located within access.
The reason this is being done is so that the database will be completely portable and stand-alone.
Any help would greatly be appreciated. Thank you.
Code:
Dim WshShell As Object
Dim X As Object
Set WshShell = CreateObject("Wscript.Shell")
WshShell.Run "Acrobat.exe [URL="file://\\shareddrive\Database\PAY.pdf"]\\shareddrive\Database\PAY.pdf[/URL]"
' delay to let the form load completely
PauseTime = 1
START = Timer
Do While Timer < START + PauseTime
DoEvents
Loop
Set App = CreateObject("Acroexch.app")
Set avDoc = CreateObject("AcroExch.AVDoc")
Set avDoc = App.GetActiveDoc
Set pdDoc = avDoc.GetPDDoc
Set jso = pdDoc.GetJSObject
' populate a couple fields
Set X = jso.getField("FULLNAME")
X.Value = Me.LAST.Value & ", " & Me.FIRST.Value
Set X = jso.getField("TONUMBER")
X.Value = Me.TONUM.Value
End Sub
I need to be able to embed the PDF within a table, have it open in a new acrobat window as read-only so that a user can make final edits and save it to their desktop or wherever.
I have no idea how VBA accesses files that are located within access.
The reason this is being done is so that the database will be completely portable and stand-alone.
Any help would greatly be appreciated. Thank you.
Last edited: