View Full Version : Jumping to URLs


paulmcdonnell
05-30-2001, 05:17 AM
Hello Again!!!!

Anyone know how you would get a command button to open expolorer and jump to a url...

Thanks
PAUL

KevinM
05-30-2001, 06:45 AM
Can't you use a hyperlink instead?
This would be much more intuitive than a button.

Benji
05-30-2001, 09:58 AM
Use the button's "HyperlinkAddress" property...

Here's some sample code that launches and verifies the syntax of a website entered in a corresponding text box:

'***
Private Sub btnLaunchWebsite_Click()
If Left(edURL1.Value, 11) = "http://www." Then
btnLaunchWebsite.HyperlinkAddress = edURL1.Value
ElseIf Left(edURL1.Value, 4) = "www." Then
btnLaunchWebsite.HyperlinkAddress = "http://" & edURL1.Value
Else
MsgBox "Please enter the website in one of the following formats: " & _
vbCrLf & vbCrLf & _
"www.blah.bla" & vbCrLf & "http://www.blah.bla" & vbCrLf & "http://www.blah.bla/", vbExclamation, "Unable to Launch Website..."
End If

End Sub