【问题标题】:Sending email to distribution list using Outlook使用 Outlook 将电子邮件发送到通讯组列表
【发布时间】: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

【问题讨论】:

    标签: vba excel email outlook


    【解决方案1】:

    您应该可以在.BCC 行中使用分发列表的名称,但我没有对此进行测试。

    .BCC = "Daily Matrix"
    

    有关详细信息,请参阅herehere

    【讨论】:

    • 很奇怪,但是当我输入通讯组列表的名称时,我得到:“Outlook 无法识别一个或多个名称”
    猜你喜欢
    • 2014-07-26
    • 1970-01-01
    • 2016-07-04
    • 1970-01-01
    • 2015-11-13
    • 1970-01-01
    • 1970-01-01
    • 2015-04-26
    • 2013-01-29
    相关资源
    最近更新 更多