Use the ShellExecute() API and it will launch any file with it's associated application, i.e.
In a Standard Module:Example Usage:VB 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 Public Sub OpenFile(ByVal sFile As String) ShellExecute 0, "OPEN", sFile, "", "", 1 End SubVB Code:
Option Explicit Private Sub Command1_Click() OpenFile "C:\SomeFile.pdf" End Sub




Reply With Quote