VB中如何打开IE并且访问指定的网页?高手指教!

来源:百度知道 编辑:UC知道 时间:2024/09/27 07:21:41

可以不使用api函数.

直接使用 shell 这个内部函数就可以了

'---------------------------
apath = "C:\Program Files\Internet Explorer\iexplore.exe"

bpath="你要打开的网页地址"

shell apath & " " & bpath,vbNormalFocus
'-------------------------------

API
Public 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

Dim fg As String
fg = "http://www.walkstudent.net"
ret& = ShellExecute(Me.hwnd, "Open", fg, "", App.Path, 1)