open webpage in default browser problem [Resolved]
ok, i want to get a webpage to open up in the default browser when you click a button. i found this code from the codebank.
VB Code:
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 OpenURL(strURL As String)
ShellExecute Me.hWnd, "open", strURL, vbNullString, "C:\", ByVal 1&
' Change the last perameter to 0& if you do not whant to show the window.
End Sub
i cant get this to work. and im wondering if anyone could lend a hand?
Re: open webpage in default browser problem
Do you get an errors when executing the code?
Re: open webpage in default browser problem
VB Code:
ShellExecute hWnd, "open", "http://www.google.com/", vbNullString, vbNullString, conSwNormal
Re: open webpage in default browser problem
I posted this a few hours ago.
Re: open webpage in default browser problem
thanks i got it to work with the code ThaRubby supplied.