9

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
David Basarab
  • 72,212
  • 42
  • 129
  • 156
Ian R. O'Brien
  • 6,682
  • 9
  • 45
  • 73

3 Answers3

12

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
cheezsteak
  • 2,731
  • 4
  • 26
  • 41
L1Wulf
  • 156
  • 1
  • 5
7

.Importance = 2 (for anyone looking in 2015).

JustoShow
  • 94
  • 1
  • 4
0

From Remou's link in the comments, this works for Outlook 2010 via VBA:

cdoMessage.Fields.Item(cdoImportance) = cdoHigh  
Simon Adcock
  • 3,554
  • 3
  • 25
  • 41