How to Launch Adobe From Visual Basic 6
- 1). Declare the ShellExecute API function. To do this, type the following code (all one line) in your form's "General Declarations" area:
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 - 2). Find the filename of the PDF file you wish to display. The filename should contain the full path to the file:
Dim PDFPath as String
PDFPath = "C:\My Documents\Sample.pdf" - 3). Display the PDF file with the ShellExecute function:
ShellExecute Me.hwnd, "open", PDFPath, 0&, "", vbNormalFocus
Source...