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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Hyperlink with default browser? 2

Status
Not open for further replies.

jreynold

Technical User
Dec 20, 2006
24
US
I have a user who wants a button to open a link in Firefox (His default internet browser) rather then IE.

The code for my button control is below, and is pretty handy. It creates a url for google maps for a location when given the address, state and zip code.

Private Sub MapItButton_Click()
'ie to google maps of project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub

Also here is code to map from central location to a address given the address, state and zip code.

Private Sub DirectionsToButton_Click()
'ie to google maps - driving directions from XXXXX to project address
Dim strURL As String
Dim ie As New InternetExplorer
strURL = " Drive,+Lake+Buena+Vista,+Florida+32830&daddr=" & Me![ProjectAddress] & ",+" & Me![ProjectCity] & ",+" & [ProjectState] & "+" & [ProjectZipCode]
ie.Navigate strURL
Do Until ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
ie.Visible = True
Set ie = Nothing
End Sub
 
If Firefox is the default browser:

instead of:
ie.Navigate strURL

use
Application.FollowHyperlink strURL

John
 
How are ya jreynold . . .

Somewhere in the [blue]options[/blue] of [blue]FireFox[/blue], you should be able to set [blue]FireFox[/blue] as the [purple]Default Browser! . . .[/purple]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
That's just way too easy for me... Not nearly complicated enough! [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top