Opening external file and program
Hi I have a simple request. I would like to place a button or link on one of my forms that would allow the user to pull up an external file. For instance I have a database of chemicals. The program lets the user search for chemicals. I would like to also place a button or link the person could use to go to the actual label. Either pull it up as a pdf, word, internet link ect..
Thanks for all the help you have given me!
Re: Opening external file and program
Use ShellExecute:
Code:
Option Explicit
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
Private Sub Command1_Click()
Dim rc As Long
rc = ShellExecute(Me.hWnd, "open", "D:\Documents\Owners\PATIENT.PDF", "", "", 1)
End Sub