views:

128

answers:

1

I tried setting a few properties on this object to send an email with high importance, but nothing seemed to work. Here is what I tried:

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
A: 

It's been a while since I worked with Outlook and VBA but I still have various cheat sheets and links. I dug this up; hope it helps!

Try setting the .Importance property in your mail object

with myEmail
    'can be olImportanceNormal, olImportanceHigh or olImportanceLow
    .importance = "olImportanceNormal" 
    .subject = "Subject line"
    .body = "Body Content"
end with
L1Wulf
Doh!Somehow I completely missed in your OP that you are using .importance.
L1Wulf
In any case, olImportanceNormal is a built-in constant and should not be in quotes.
Remou
@Remou: good catch.
L1Wulf