You should use the ShellExecute Api to open a file with it's default program:
have fun!Code:'Put this in a module Public 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 'Open a file with it's default program Public Sub Execute(file As String) lngResult = ShellExecute(hWnd, "Open", file, "", "", vbNormalFocus) End Sub 'In a form: Call Execute("c:\MyFile.pdf")




Reply With Quote