Here ya gowww
Code: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 Private Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long Public Sub Navigate(Url As String) Dim sEXE As String sEXE = FindBrowserEXE If Len(sEXE) Then ShellExecute hWnd, "OPEN", sEXE, Url, "", 1 End If End Sub Function FindBrowserEXE() As String Dim sPath As String Dim iFile As Integer sPath = space(255) iFile = FreeFile Open "C:\Temp.htm" For Output As iFile Close iFile 'this part isn't mine, can't remember where I got it. FindBrowserEXE = Left(sPath, FindExecutable("C:\Temp.htm", "", ByVal sPath)) Kill "C:\Temp.htm" End Function
Place it in a module and run
Hope that helpsCode:Navigate "http://www.cool.com"![]()





Reply With Quote