Dim olApp As Outlook.Application
Dim myMail As MailItem
If IsNull(Me.收件人地址) Then
MsgBox "请输入收件人地址。", 64, "提示"
Exit Sub
ElseIf IsNull(Me.主题) Then
MsgBox "请输入主题。", 64, "提示"
Exit Sub
ElseIf IsNull(Me.正文) Then
MsgBox "请输入正文。", 64, "提示"
Exit Sub
End If
Set olApp = Outlook.Application
Set myMail = olApp.CreateItem(olMailItem)
With myMail
.Recipients.Add (Me.收件人地址)
If IsNull(Me.抄送) = False Then .CC = Me.抄送
If IsNull(Me.秘密抄送) = False Then .BCC = Me.秘密抄送
.Subject = Me.主题
.Body = Me.正文
If IsNull(Me.附件) = False Then .Attachments.Add (Me.附件)
'If Me.Check58 Then myMail.Display
.Save
.Send
End With