LabRat
LabRat

Reputation: 2014

Name 'AdobeReader' is not declared vb.net

I'm trying to follow a tutorial but I keep getting the warning:

Name 'AdobeReader' is not declared

Can sombody tell me what is wrong? The tutorial is found here, and I'm trying out Answer 2 from that page, which says:

Here is another way to read pdfs.

Right click on any of the tabs in your toolbox and click choose items.(Just make sure you have a version of adobe reader installed before starting.) When the dialog box pops up click the 'com components' tab then pick tha 'adobe pdf reader' com component. Click ok and you should now see a 'adobe pdf reader' control in your toolbox. Click this and drag it to your vb form.(you may need to resize it, usually appears very small). Now in order to read any pdf just alter the 'src' property of the control either in code or in the designer. when you run the program you should be able to view the pdf doc in the vb form with most of the options you get in adobe reader. Here is how you would alter the 'src' property in code.

PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load 
    AdobeReader.src = "C:\mydoc.pdf"
End Sub

Upvotes: 0

Views: 984

Answers (1)

makim
makim

Reputation: 3284

If I´m getting your Question right, you just want to open a PDF-File. Simply call:

Process.Start("Path/To/MyPdfFile.pdf")

Upvotes: 2

Related Questions