' Sign off of the mail system.
mpsErrorMail.SignOff
Exit Sub
SendErrorMailError:
' There was an error sending the mail.
' Just present the message.
MsgBox "Error " & Format$(Err.Number) & _
" sending mail." & vbCrLf & _
Err.Description
Exit Sub
End Sub
Private Sub Form_Resize()
Dim wid As Single
Dim hgt As Single
在 Visual Basic 中,MAPI 控件可用于与基本的消息子系统进行交互。要使用这些控件,则必须先安装适应 MAPI 的电子邮件系统,比如 Microsoft Exchange。基本的消息服务已由工作组环境提供了,比如说,在 Windows 95 或 Windows NT 环境下运行的 Microsoft Exchange 服务器。
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