vb中如何用代码启动电子邮件

来源:百度知道 编辑:UC知道 时间:2024/05/15 18:14:51

先在通用里声明:
Option Explicit
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 Const SW_SHOW = 5
画个标签caption值为你设的E-mail,它的cliek事件过程为:
Private Sub Label2_Click()
Label2.ForeColor = &H800080
Call ShellExecute(Me.hWnd, "open", "mailto:gshan@etang.com", "", "", SW_SHOW)
End Sub
很容易吧?