簡體   English   中英

Excel VBA:如何向Outlook中的組發送電子郵件?

[英]Excel VBA: How to send email to group in outlook?

我希望自動從excel vba發送電子郵件到Outlook 2013。

我可以將電子郵件發送給個人並通過TITUS分類,但是當我發送到團體電子郵件時仍然出現以下錯誤。

如何在VBA中選擇“ 仍然發送 ”?

在此處輸入圖片說明

以下是我必須發送電子郵件的代碼:

Dim AOMSOutlook As Object
Dim AOMailMsg As Object
Set AOMSOutlook = CreateObject("Outlook.Application")
Dim objUserProperty As Object
Dim OStrTITUS As String
Dim lStrInternal As String
Set AOMailMsg = AOMSOutlook.CreateItem(0)

Set objUserProperty = AOMailMsg.UserProperties.Add("TITUSAutomatedClassification", 1)
objUserProperty.Value = "TLPropertyRoot=ABCDE;Classification=Internal;Registered to:My Companies;"
With AOMailMsg
        .To = "mygroup@list.company.com"
        .Subject = "my subject"
        .Attachments.Add Img
        .HTMLBody = "my text"            
        .Save
        .Send
End With
Set AOMailMsg = Nothing
Set objUserProperty = Nothing
Set AOMSOutlook = Nothing
Set lOMailMsg = Nothing
Set objUserProperty = Nothing
Set lOMSOutlook = Nothing

任何幫助,不勝感激!

感謝@MattCremeens能夠通過添加以下內容來解決:

    .display
    SendKeys "{DOWN}{DOWN}{ENTER}", True 'set classification
    SendKeys "{ENTER}",True 'send to group
    .send
End With

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM