使用api函数shellexecuteprivate 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 shellexecute 0&, vbnullstring, "http://www.123.com", vbnullstring, vbnullstring, vbnormalfocus shellexecute me.hwnd, "open", "mailto:[email protected]", vbnullstring, vbnullstring, sw_show 还有人说下面这样也可以,不过我没有试过。连接到网页: shell "rundll32.exe url.dll,fileprotocolhandler http://www.online.sh.cn"
Private Sub Command1_Click() Dim myIe As Object Set myIe = CreateObject("InternetExplorer.Application") myIe.Navigate "http://office.9zp.com" myIe.Visible = True End SubPrivate Sub Command2_Click() Dim myIe As Object Set myIe = CreateObject("InternetExplorer.Application") myIe.Navigate "mailto:[email protected]" myIe.Quit End Sub
(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 shellexecute 0&, vbnullstring, "http://www.123.com", vbnullstring, vbnullstring, vbnormalfocus shellexecute me.hwnd, "open", "mailto:[email protected]", vbnullstring, vbnullstring, sw_show 还有人说下面这样也可以,不过我没有试过。连接到网页:
shell "rundll32.exe url.dll,fileprotocolhandler http://www.online.sh.cn"
Dim myIe As Object
Set myIe = CreateObject("InternetExplorer.Application")
myIe.Navigate "http://office.9zp.com"
myIe.Visible = True
End SubPrivate Sub Command2_Click()
Dim myIe As Object
Set myIe = CreateObject("InternetExplorer.Application")
myIe.Navigate "mailto:[email protected]"
myIe.Quit
End Sub