UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Visual Studio Not Showing Adobe Com Component    
 
   
Marto
post Jan 31 2017, 05:07 PM
Post#1



Posts: 394
Joined: 13-January 03
From: Dublin, Ireland


Hi
I am new to visual studio and i am trying some tutorials.
One of them relates to loading and viewing a pdf in a form. However, one of the steps relates to using the adobe COM component from the tool box but it is not there like it shows in the tutorial.
Any help is appreciated.

Martin

--------------------
There is nothing in the world that some man cannot make a little worse and sell a little cheaper, and he who considers price only is that man's lawful prey.
Go to the top of the page
 
JForbes
post Feb 1 2017, 07:56 AM
Post#2



Posts: 32
Joined: 11-November 16
From: Indianapolis, IN


My guess as to why you can't find the ActiveX object is that it hasn't been installed on your computer. So if you absolutly have to finish your tutorial, you'll need to install either Adobe Acrobat Reader, Adobe Acrobat or possibly the SDK.

If you don't need to finish the Tutorial, but would still like to display a .PDF in and Access Form:
  • Create a new Blank Form.
  • Select Insert ActiveX Control from the Ribbon.
  • Scroll down and find and Select the "Microsoft Web Browser", and click OK.
  • Add the following code to FormLoad Event:

CODE
Private Sub Form_Load()
    Dim sPDF As String
    sPDF = "C:\temp\SomePDF.pdf"     ' Replace this with an actual path and file name of an existing PDF
    Me.WebBrowser0.Navigate2 sPDF    ' If you started with a blank Form, the Web Browser should be named WebBrowser0
End Sub

  • Make sure you change the setting of sPDF to an actual file name on your computer.
  • Run your Form and the PDF should be loaded into the WebBrowser control.


*Edit*
I just realized that you are talking about Visual Studio instead of Microsoft Access. I'm so used to Access Questions. It's pretty much the same in Visual Studio. You'll still need to install the control from Adobe if you want to continue your Tutorial.

Or you can follow the previous steps with a little modification and get the PDF to display on a Form:
  • Either create a New WinForms Project or Create a new Windows Form in your Project. If you add the Form to an existing project, right-click the Project in the Solution Explorer and edit the Properties to set the Startup Form to the Newly created Form.
  • Drag and Drop the WebBrowser control from the ToolBox onto the New Form.
  • Add the following code to the FormLoad Event:
CODE
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim sPDF As String = "C:\temp\SomePDF.pdf"    ' Replace this with an actual path and file name of an existing PDF
        Me.WebBrowser1.Navigate(sPDF)                 ' If you started with a blank Form, the Web Browser should be named WebBrowser1
    End Sub

  • Make sure you change the setting of sPDF to an actual file name on your computer.
  • Run your Project and the PDF should be loaded into the WebBrowser control.
Go to the top of the page
 
Marto
post Feb 1 2017, 11:48 AM
Post#3



Posts: 394
Joined: 13-January 03
From: Dublin, Ireland


HI

I have adobe loaded on my PC and should be able to see it. this is why i thought i might be missing something.
I will try your suggested alternative method

Thanks for the reply.
Martin

--------------------
There is nothing in the world that some man cannot make a little worse and sell a little cheaper, and he who considers price only is that man's lawful prey.
Go to the top of the page
 
JForbes
post Feb 1 2017, 02:50 PM
Post#4



Posts: 32
Joined: 11-November 16
From: Indianapolis, IN


I didn't think of this earlier. I had Access on the Brain and just expected that you were missing the Control...
  • Right-Click on the Toolbox on the Tab you would expect to find the Adobe Control (like All Windows Forms), and Select Choose Items. (It might take a while to load)
  • Select the COM Components Tab
  • See if your control is in the list. My guess would be Adobe PDF Reader or something similar.
  • If you find a control or a few controls that look promising, tick the Checkbox to their left.
  • The controls you ticked should be added to the Toolbox Tab. Probably at the bottom of the Tab.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 10:43 AM