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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening PDF Files in VB

Status
Not open for further replies.

Gutes

Programmer
Dec 5, 2001
16
AR
Does anybody know how to open a pdf fiel from vb. Not only to open it, but also opening it in positioned in a specific page.
Anythig would be helpful.
Thanks
 
Try using the shell or shellexecute command to open the file.
Code:
Shell "c:\test.pdf"
or
Code:
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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: [URL unfurl="true"]http://www.allapi.net/[/URL]
    'E-Mail: KPDTeam@Allapi.net
    'Send an E-Mail to the KPD-Team
    ShellExecute Me.hwnd, vbNullString, "c:\test.pdf", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
See for more information.




----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top