Public Sub 技巧19_013()
Dim wbStr As String
Dim OutlookApp As Outlook.Application
Dim newMail As Outlook.MailItem
Dim myAttachments As Outlook.Attachments
Set OutlookApp = New Outlook.Application
wbStr = ThisWorkbook.FullName '指定要发送发工作簿名称字符串
Set newMail = OutlookApp.CreateItem(olMailItem) '创建新邮件
With newMail
.Subject = "附件实验" '设置邮件主题
.Body = "附件工作簿实验:" '设置邮件正文
Set myAttachments = newMail.Attachments
myAttachments.Add wbStr, olByValue, 1, "工作簿"
.To = "as k <qw15370095879@outlook.com>; as k <qw15370095879@outlook.com>; as k <qw15370095879@outlook.com>" '设置收件人地址
.Send '开始发送
End With
Set newMail = Nothing
Set myAttachments = Nothing
Set OutlookApp = Nothing
End Sub