Jumping to URLs

paulmcdonnell

Ready to Help
Local time
Today, 22:00
Joined
Apr 11, 2001
Messages
167
Hello Again!!!!

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

Thanks
PAUL
 
Can't you use a hyperlink instead?
This would be much more intuitive than a button.
 
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
 

Users who are viewing this thread

Back
Top Bottom