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
In VBA, to send emails from Excel, we can automatically automate our mailing feature to send emails to multiple users at a time. However, to do so, we need to remember that we may do it by outlook, another product of outlook, so we need to enable outlook scripting in VBA. Once done, we use the .
Setting messages to high importance notifies recipients that the message is urgent and needs attention. If the message is an FYI, or non-work related topics, you can set the low importance indicator.
To create a new macro In Outlook, on the Developer tab of the Microsoft Office Fluent ribbon, click Visual Basic. In the Project window, double-click the module you want to contain the macro. On the Insert menu, click Procedure. In the Name box, type a name for the macro.
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
.Importance = 2 (for anyone looking in 2015).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With