【发布时间】:2016-07-26 20:57:31
【问题描述】:
我目前有可以完美运行的代码,可以将我打开的活动工作簿发送给我指定的任何人。
但是,我想将工作簿发送到 Outlook 联系人中名为“每日矩阵”的分发列表,并希望将其密件抄送。我不知道该怎么做,我们将不胜感激。谢谢!
Sub Mail_Workbook_1()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = ""
.CC = ""
.BCC = ""
.Subject = "Daily Matrix"
.Body = "PLEASE DO NOT DISTRIBUTE-FOR INTERNAL USE ONLY"
.Attachments.Add ActiveWorkbook.FullName
' You can add other files by uncommenting the following line.
'.Attachments.Add ("C:\test.txt")
' In place of the following statement, you can use ".Display" to
' display the mail.
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
【问题讨论】: