2016-07-26 103 views
1

我目前擁有完美的代碼,可以將我開放的活動工作簿發送給我指定的任何人。使用Outlook將電子郵件發送到通訊組列表

不過,我想工作簿發送到我的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 

回答

0

你應該能夠在.BCC線使用通訊組列表的名稱,但我沒有測試過這一點。

.BCC = "Daily Matrix" 

欲瞭解更多信息,請參閱herehere

+0

這沒有奏效! – markos

+0

非常奇怪,但是當我鍵入分配列表的名稱時,出現:「Outlook無法識別一個或多個名稱」 – markos

相關問題