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
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 '调用浏览器或EMAIL软件
Const MailAddress = "mailto:sunisle@126.com"
Public Sub WriteEmail(Optional TempSubject As String)
'参数可选,缺省值是空
ShellExecute 0&, vbNullString, MailAddress + "?subject=" + TempSubject, vbNullString, vbNullString, vbNormalFocus
End Sub
Sub VisitHttp(Optional TempHttp As String = "http://sunxiao.126.com")
'参数可选,缺省值是http://sunxiao.126.com
ShellExecute 0&, vbNullString, TempHttp, vbNullString, vbNullString, vbNormalFocus
End Sub
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 Label1_Click()
ShellExecute vbnullstring,vbnullstring,"http://url",vbnullstring,vbnullstring,1
End sub