3.基于IE浏览器的
+++++++++++++++++++源码1(使用IE对象)++++++++++
Dim Browser As Object
url="http://hi.baidu.com/yueguang520"
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Visible = True
Browser.Navigate (url)
+++++++++++++++++++源码2++++++++++++++++++++++
Private Sub cmd1_Click()
url = "http://hi.baidu.com/yueguang520"
exe = Environ("programfiles") & "\Internet Explorer\IEXPLORE.EXE"
Shell exe & Space(1) & url, 1
End Sub
5.基于API的
'API函数声明 :
+++++++++++++++++++源码++++++++++++++++++++++
Private Declare 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 Const SW_SHOWNORMAL = 1
'函数返回值为大于32的整数表明成功执行调用,小于或等于32表明调用失'败。
'例如:
Dim Result
Result = ShellExecute(0, vbNullString, "http://hi.baidu.com/yueguang520", vbNullString, vbNullString, SW_SHOWNORMAL)