我目前拥有完美的代码,可以将我已打开的活动工作簿发送给我指定的任何人。
但是,我想将工作簿发送到名为“Daily Matrix”的Outlook联系人的分发列表中,并希望将它们作为BCC。我不知道该怎么做,我们将不胜感激。谢谢!
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