?
Solved

WebBrowser Control in Access 2010 opens PDF file in Acrobat, not in form

Posted on 2012-03-29
8
Medium Priority
?
2,574 Views
Last Modified: 2012-03-30
In Access 2010, I created a test form with a single control, a WebBrowser control. The control has a valid PDF file as its control source: ="F:\My Data Sources\TestDocs\TestFile01.pdf".

When I open the form, the file is displayed in Acrobat X (V. 10.1.2) and nothing shows in the Webbrowser control.

How can I get the PDF to display directly in the form's webbrowser control rather than in Acrobat?
0
Comment
Question by:Pelegrinus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 34

Expert Comment

by:Norie
ID: 37782428
How is your browser set to display PDFs?
0
 

Author Comment

by:Pelegrinus
ID: 37782710
In my IE browser, I typed in the location of the file as shown in my original post and it opened the file in Acrobat. I'm looking to see how I can change that, but any recommendations on how I can do it would be appreciated.
0
 
LVL 34

Expert Comment

by:Norie
ID: 37782908
You can open Acrobat Reader, goto Edit>Preferences..., select Internet and check Display PDF in browser.
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:Pelegrinus
ID: 37783252
I've now tried that, with no luck. But, on a "dare," I downloaded Acrobat Reader, even though I have a working Acrobat X application working well. Immediately after I installed Reader, both the IE browser and my WebBrowser control display PDF files directly. I don't know exactly what I fixed, but I now have a working application. Thank you for your help.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37783459
FWIW...

No need to set a cotrolsource of the web browser...

"Navigate" to the file instead:

Me.WebBrowser0.Navigate "c:\YourFolder\Yourpdf.pdf"

This works with the reader of the full version, ..no need to install both if you don't have to...
(Remember the full version is big $$$, and not all machines my have it installed)

JeffCoachman
0
 

Author Comment

by:Pelegrinus
ID: 37783626
Is there a difference between a web browser object and a web browser control object? I seem to have the ability to use only the web browser control object, and I have to use the syntax:

me.WebBrowser0.Object.Navigate "PathAndFile"

Are we talking about the same things?
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 1500 total points
ID: 37783767
LOL!
I believe we are referring to the same thing.

Over the past 10 years I have seen at least 4 different (syntax) ways to do this.
..Basically, you just pick the one that works for you...
;-)

But again, I have never actually seen the webbrowser controlsource property used, (Because the control is typically used to display "Web" data,)

So since .Navigate will work in either case (Disc files or web pages), then most people will just stick with that .Navigate...

;-)

Jeff
0
 

Author Comment

by:Pelegrinus
ID: 37787309
Thanks!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question