Excel VBA:如何发送电子邮件到Outlook中的组?
我期待自动发送电子邮件从Excel VBA到Outlook 2013。
我能够发送电子邮件给个人,并通过TITUS分类,但是当我发送到组邮件时,仍然出现以下错误。
如何在VBA中select“ 发送 ”?
以下是我必须发送电子邮件的代码:
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