In your declarations at the top of the code, paste:
[CODE=vb]Public Declare Function ShellExecute Lib "shell32.dl l" Alias "ShellExecu teA" (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[/CODE]
And then use this function:
[CODE=vb]Public Function ShellExec(ByVal strFile As String)
Dim x As Long: x = ShellExecute(0, "OPEN", strFile, "", "", 0)
End Function[/CODE]
Passing the filepath as a parameter.
Hope that helps.
Last edited by Killer42; Aug 17 '07, 03:45 AM.
Reason: Added [CODE=vb] tag
In your declarations at the top of the code, paste:
[CODE=vb]Public Declare Function ShellExecute Lib "shell32.dl l" Alias "ShellExecu teA" (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[/CODE]
And then use this function:
[CODE=vb]Public Function ShellExec(ByVal strFile As String)
Dim x As Long: x = ShellExecute(0, "OPEN", strFile, "", "", 0)
End Function[/CODE]
Passing the filepath as a parameter.
Hope that helps.
Woa, that's very nice. Sometimes I would be called Shell excute function, but Shell command in VB can't archive parameters with space character.
Comment