Helpful Information
 
 
Category: Computer Programming
VB: form button that opens a link in browser...

hey hey:)
.. hm can this be done in vb? if so .. how?
thanks:)
sir p

You bet you can, just dump this into your form and then copy the code thats in the Command1_Click() sub into the sub for the right button on your form.



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


Private Sub OpenFile(sURL As String)
Dim nRetVal As Long
If sFile = "" Then Exit Sub
ShellExecute nRetVal, "open", sURL, "", "", 1
End Sub

Private Sub Command1_Click()
OpenFile "http://www.codingforums.com"

End Sub

Thanks alot man:thumbsup:

P










privacy (GDPR)