如何在使用VBA发送的电子邮件中设置“高重要性”?

时间:2010-07-21 17:24:49

标签: email vba cdo.message

我尝试在此对象上设置一些属性以发送一个具有高重要性的电子邮件,但似乎没有任何效果。这是我试过的:

objEmail.Importance = 2

objEmail.Configuration.Fields.Item("urn:schemas:mailheader:X-MSMail-Priority") = "High"      ' For Outlook 2003

objEmail.Configuration.Fields.Item("urn:schemas:mailheader:X-Priority") = 2                  ' For Outlook 2003 also

objEmail.Configuration.Fields.Item("urn:schemas:httpmail:importance") = 2

Function Send(sTo As String, sFrom As String, sSubject As String)
    Set objEmail = CreateObject("CDO.Message")
        objEmail.From = sFrom
        objEmail.To = sTo
        objEmail.Subject = sSubject
        objEmail.Textbody = emailBody
        objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "my.smtp.server"
        objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        // is there a property for high importance, outlook 2007?
        objEmail.Configuration.Fields.Update        
    objEmail.Send
End Function

3 个答案:

答案 0 :(得分:8)

自从我使用Outlook和VBA以来已经有一段时间了,但我仍然有各种备忘单和链接。我挖了这个;希望它有所帮助!

尝试在邮件对象中设置.Importance属性

with myEmail
    'can be olImportanceNormal, olImportanceHigh or olImportanceLow
    .Importance = olImportanceNormal
    .Subject = "Subject line"
    .Body = "Body Content"
end with

答案 1 :(得分:5)

.Importance = 2(对于2015年的任何人)。

答案 2 :(得分:0)

在评论中从Remou's link开始,这适用于Outlook 2010中的VBA:

cdoMessage.Fields.Item(cdoImportance) = cdoHigh