Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open PDF document from VB 6

Status
Not open for further replies.

balajee

Programmer
Jun 29, 2000
134
NZ
Hi

Can somebody tell me how to open a PDF document from visual Basic 6.0. I would like to open a pdf file when I click on a command button.

Thanks
 
Dim x as Double
x = Shell("C:/Program Files/Adobe/Acrobat 4.0/Reader/AcroRd32.exe ""C:/Program Files/Adobe/Acrobat 4.0/Reader/ReadMe.PDF"" ")
Tim

Remember the KISS principle:
Keep It Simple, Stupid!
 
Hi

Thanks for your quick reply. But how do I know what version the user is having. Then it may not be installed in the normal dir "Programme files". How do I take this into consideration?
 
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


Sub main()
Call ShellExecute(0&, "Open", "C:\Your.pdf", 0&, 0&, 0&)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top