Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Engaging the Default Browser 1

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I have code to open IExplorer, but what if IE is not the prefered browser of the user. How do I open the DEFAULT browser ??

Steady ...
 
Use the ShellExecute API call and pass it the name of the .html file you want opened (or a full URL). It will use the file associations set up in the registry to open the default browser.

Chip H.
 
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 Function Navigate(strUrl As String) As Long
    Dim hWnd As Long
    Navigate = ShellExecute(hWnd, vbNullString, strUrl, vbNullString, _
                    vbNullString, vbNormalFocus)
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top