1,486
社区成员
发帖
与我相关
我的任务
分享
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 Command1_Click()
' Shell "rundll32.exe url.dll,FileProtocolHandler http://www.baidu.com" '方法1
' Shell "cmd.exe /c start http://www.baidu.com", 0 '方法2
' Shell "explorer.exe http://www.baidu.com", 1 '方法3
ShellExecute hwnd, "open", "http://www.baidu.com", "", "", 1 '方法4
ShellExecute 0, "open", "IEXPLORE.EXE", "http://www.baidu.com", "", 1 '方法5
End Sub
'另外:
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
ie.navigate "http://www.baidu.com"