I.T. Discussion Community!
-Collapse +Expand
Search Access Group:

-Collapse +Expand Access To/From
-Collapse +Expand Access Store

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► KBDesktop Data...Access & VBA   Print This     
Access & VBA:
How I Make a Multiple Page PDF File Scroll to a Specific Page in a Browser
Posted 15 months ago on 4/20/2019
Take Away:

This article discusses a programming technique I used in a Microsoft Access database application to display a multiple page PDF document and make it position itself at a specific page.


I have been finishing a Microsoft Access database software application for a longtime customer. One of the things it does is retrieve and display a previously created multiple page PDF document of his certificates or “certs” (he performs a calibration service for industrial businesses). When the PDF document is displayed, it must scroll to a specific page or “cert”.

The MS Access code is relatively simple, but like anything else, you need to know how to orchestrate it so it works:

strPath1 = """C:\Program Files (x86)\Opera\launcher.exe"""

strPathPDF = Combo42.Column(2)

strPathPDFPageNo = Combo42.Column(3)

strPath2 = strPathPDF & "#page=" & strPathPDFPageNo & ""

shell strPath1 & " " & strPath2, vbNormalFocus

The first line in the programming assigns the file path location of the browser or PDF viewer you are going to assign to a MS Access string variable called strPath1. This code would not work with just any PDF viewer. I could only get it to work with Internet Explorer or the Opera browser (I am using Opera as you can see from the file path in the first line of code). I could not get it to work right with Google Chrome or Mozilla Firefox. I also have Adobe Acrobat Reader DC on my computer and even that would not work correctly. All it did was open Adobe and display a list of PDFs to be displayed.

The second line of code assigns the file path of the PDF document to be retrieved into a string variable called strPathPDF from a column in a combo box control on the input screen. The third line of code assigns the page number associated with the PDF document into a string variable called strPathPDFPageNo from another column of the same combo box selection. The fourth line of code will concatenate strPathPDF with the literal string, “#page=” and then concatenate that with strPathPDFPageNo followed by a couple of double quotes on the end of the new string expression.

The fifth and final line of code uses the shell command, which loads the concatenated string argument, strPath1 & " " & strPath2 and then a comma separating it from the vbNormalFocus specifier. This will display the specified PDF document positioned on the specified page number.                          

This code can be very useful for any type of business or organization that needs to quickly view a multiple page PDF document without having to waste time with scrolling to a specific page within it. It is yet another way to streamline a task and economize time, which is what all software design customers expect.


Share a thought or comment...
Comment 1 of 2

Kaspersky Login code protects your system from threat. it code search  the virus from you your personal computer and malware them and build your system fast. it‘s imagining code. To many information connect here kaspersky-login.com.

Dragon naturally speaking support
HP Printer Offline
Brother Printer offline
Kaspersky Login
Garmin Login
Avg login
TurboTax Support
avg account login

Posted 8 months ago

Comment 2 of 2

AVG antivirus is a prominent virus protection program among the world of software . As many hackers and data stealers are waiting for the user’s mistake, they can misuse of user’s identity and other data.
www.avg.com/retail , avg.com/retail

Posted 47 days ago
Write a Comment...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1165A1
Enter key:
Article Contributed By Douglas.M:

Please visit my software developer website for more information about my services. I offer application development as well as Android app coding services. My developer skills are best suited to dealing with custom software projects. I can perform programming for Corel Paradox as well as C# Sharp and PHP.

In my local area of northeast Ohio, I can cater to computer repair and "fix my computer" issues.

Use my contact web page today to reach me about any software design ideas you have.

Visit Profile

 KB Article #103857 Counter
Since 4/20/2019

Follow PrestwoodBoards on: 

©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech