[英]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.