There are two methods you can use:
Code:
Private Sub Command1_Click()
Shell Chr(34) & "C:\Program Files\Acroread\Acrord32.exe" & Chr(34) & " SomePDF.pdf", vbNormalFocus
End sub
Where Acrord32.exe is the Acrobat Reader EXE and SomePDF.pdf is the File and Path of the PDF you want to launch.
Or, more intuitively..
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
Private Sub Command1_Click()
ShellExecute 0&, "OPEN", "SomePDF.pdf", "", "", 1
End Sub
This method doesn't require you to know the location or name of the PDF Reader, as it launches the Associated EXE.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]