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

Opening pdf files with VB6 1

Status
Not open for further replies.

nardac

Automotive
Joined
Feb 5, 2002
Messages
8
Location
GB
I need to display a manual which is saved as a pdf file.
I would like to do this by clicking on a control button in a main menu screen.
Does anyone have any code to do this or alternatively a code that will open the acrobat reader and then the pdf file.

All replies appreciated

Thanks in advance

Regards

Steve Edwards
 
You can use ShellExecute to open any file in its associated application.
Code:
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 OpenTheFile()
  Dim hWnd As Long
  Dim sFile As String
  sFile = "C:\Temp\YourFile.pdf"

  Call ShellExecute(hWnd, vbNullString, sFile, vbNullString, vbNullString, vbNormalFocus)

End Sub


DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top