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'************************************************
'打开Web网页
'************************************************
Public Function GoToWeb(WebAddress As String) As Long
On Error GoTo ErrDescription
Dim lRet As Long
lRet = ShellExecute(0&, vbNullString, WebAddress, vbNullString, vbNullString, vbNormalFocus)
GoToWeb = lRet
Exit Function
ErrDescription:
MsgBox err.Description
End Function
private sub command1_click() gotoweb "http://www.sina.com.cn"
sendkeys "{F1}" '打开IE的帮助,这是一个例子,其他动作可以自己定义,参照Sendkeys的参数
end sub
"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'************************************************
'打开Web网页
'************************************************
Public Function GoToWeb(WebAddress As String) As Long
On Error GoTo ErrDescription
Dim lRet As Long
lRet = ShellExecute(0&, vbNullString, WebAddress, vbNullString, vbNullString, vbNormalFocus)
GoToWeb = lRet
Exit Function
ErrDescription:
MsgBox err.Description
End Function
private sub command1_click() gotoweb "http://www.sina.com.cn"
sendkeys "{F1}" '打开IE的帮助,这是一个例子,其他动作可以自己定义,参照Sendkeys的参数
end sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货