By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,032 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,032 IT Pros & Developers. It's quick & easy.

How to set Outlook Importance property and Follow Up Reminder from VB .NET using CDO

P: n/a
This sample code demonstrates how to send an email message using CDO and
have it set the Outlook Importance property and the Outlook Follow Up
reminder attributes in the recipient's InBox.

The "Follow Up" reminder flag is set to one hour ago which causes the
received message's From, Subject and Date to immediately display in red
color in the recipient's Outlook InBox.
'Add references to:
'--Microsoft Active Data Objects (ADO)
'--Microsoft CDO for Exchange 2000
Dim oMsg As CDO.Message
Dim oFields As ADODB.Fields
Dim oField As ADODB.Field
Try
'Get reference to CDO message object
oMsg = New CDO.Message
oMsg.To = "mi*********@nospam.net"
oMsg.From = "jo***********@nospam.net"
'
'The Message object's default item property is read-only, however,
'the ADODB Field object it returns to
'has read/write access to the specific property
'you requested
'
'Get a reference to the "importance" property
oField = oMsg.Fields.Item("urn:schemas:mailheader:importanc e")
'Assign the property a "high" value
oField.Value = "high"
'
'This property specifies what type of Follow Up flag
oMsg.Fields.Append("urn:schemas:mailheader:x-message-flag", _
ADODB.DataTypeEnum.adVarChar, -1, _
ADODB.FieldAttributeEnum.adFldFixed, "Follow Up")
'
'When to Follow Up
' This sets the follow up time to one hour ago.
' This causes the message line in the Outlook InBox to be set to red
color
' as soon as the message is received.
oMsg.Fields.Append("urn:schemas:httpmail:reply-by", _
ADODB.DataTypeEnum.adVarChar, -1, _
ADODB.FieldAttributeEnum.adFldFixed, DateAdd("s", -3600, Now))
'
'Update the fields
oMsg.Fields.Update()
'
'Send the message
oMsg.Send()
Catch ex As Exception
Throw ex
Finally
oMsg = Nothing
End Try

//End of Message//

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.