Hi all,
I've been searching for a code that allows me to open up specific pages in a PDF file, through the click of a button in a form.
I have seen success with the following code:
Dim strPage As String, strFullPathToFile As String, strFullPathToAdobeReader As String
strFullPathToAdobeReader = "C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"
strPage = "4"
strFullPathToFile = "F:\DatabaseMaterial\ViaSatellite2011Directory.pdf"
strFullCommandLine = """" & strFullPathToAdobeReader & """ /A page=" & strPage & "=OpenActions " & strFullPathToFile & """"
varRetVal = Shell(strFullCommandLine, vbNormalFocus)
However, I also want to be able to run this code under certain conditions & parameters. For example, I have added a field to the source table that has page numbers for each record. Whenever a certain record appears in the form, along with its corresponding page number, I want the code to open the PDF based on that information. Is this possible?
I would really appreciate it if someone could offer a solution! Thanks for your time in advance!
I've been searching for a code that allows me to open up specific pages in a PDF file, through the click of a button in a form.
I have seen success with the following code:
Dim strPage As String, strFullPathToFile As String, strFullPathToAdobeReader As String
strFullPathToAdobeReader = "C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe"
strPage = "4"
strFullPathToFile = "F:\DatabaseMaterial\ViaSatellite2011Directory.pdf"
strFullCommandLine = """" & strFullPathToAdobeReader & """ /A page=" & strPage & "=OpenActions " & strFullPathToFile & """"
varRetVal = Shell(strFullCommandLine, vbNormalFocus)
However, I also want to be able to run this code under certain conditions & parameters. For example, I have added a field to the source table that has page numbers for each record. Whenever a certain record appears in the form, along with its corresponding page number, I want the code to open the PDF based on that information. Is this possible?
I would really appreciate it if someone could offer a solution! Thanks for your time in advance!