Ok
Well now that my loop is working I was hoping some one chould tell me how to make Internet Explorer go to a web site when I press a butten on my form
Thanks
P.s. the form will also hide and do other stuff when the butten is pressed
Printable View
Ok
Well now that my loop is working I was hoping some one chould tell me how to make Internet Explorer go to a web site when I press a butten on my form
Thanks
P.s. the form will also hide and do other stuff when the butten is pressed
The simpliest way is to use ShellExecute:
Good luck!Code: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 Command1_Click()
ShellExecute Me.hwnd, "Open", "http://www.vb-world.net", _
"", "", vbNormalFocus
End Sub
where do I put the
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
API declarations would usually go in a module but you can put it in a form if you put "Private Declare Function ...."
I'll nip in here & answer this bit!
put a private before that and place the code right at the top of the form (above everything else).
Hope this helps!
Alex Read