Jupiter-SL9
Jul 22nd, 2001, 05:51 PM
hi
What is the API that identify what program must open determinated file?
I need to call a web browser or something to open a html file.
thanks
bye
Matthew Gates
Jul 23rd, 2001, 12:24 AM
Just use the ShellExecute API function, which will open a file's associated program.
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 OpenFile(sFile As String)
ShellExecute Me.hwnd, "Open", "C:\MyPage.htm", vbNullString, vbNullString, 1
End Sub