我遵循了下面的示例:
https://www.slipstick.com/developer/create-a-new-message-using-vba/
我希望在通过宏发送电子邮件时自动对邮件进行分类。但是,有时类别在类别中。
例如,假设“报表”类别在“公司”类别下。
如何将我的已发送邮件分配到“公司”类别中的“报告”类别?这是我的代码。它与示例代码几乎相同。
Public Sub CreateNewMessage()
Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)
With objMsg
.To = "Alias@domain.com"
.CC= "Alias2@domain.com"
.BCC = "Alias3@domain.com"
.Subject = "This is the subject"
.Categories = "Test"
.VotingOptions = "Yes;No;Maybe;"
.BodyFormat = olFormatPlain ' send plain text message
.Importance = olImportanceHigh
.Sensitivity = olConfidential
.Attachments.Add ("path-to-file.docx")
' Calculate a date using DateAdd or enter an explicit date
.ExpiryTime = DateAdd("m", 6, Now) '6 months from now
.DeferredDeliveryTime = #8/1/2012 6:00:00 PM#
.Display
End Withhttps://stackoverflow.com/questions/47789426
复制相似问题