473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
0 9592

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John | last post by:
Hi I am trying to open a new outlook message and add a user defined property to it, from within MS Access using the below code. I am getting an 'Object variable or With block variable not set'...
14
by: Prabhudhas Peter | last post by:
Hai, I've Created a User control for example a Button and i've given the font of the text as Bold and compiled it. Now i've used this Usercontrol everywhere in my project. Now i changed the font...
4
by: azeet.chebrolu | last post by:
Hi All, I am trying to update the location of an IFRAME using javascript.My script works fine when the target link is some .htm or .asp but the script fails when the link is a cgi program.the...
1
by: Nays | last post by:
Hello I am writing a COM Add-In for Outlook 2003 that will have a number of forms. I would like these to be styled like Office 2003 and not just XP style. Is this possible by somehow referencing...
0
by: sudhashekhar30 | last post by:
hi i m trying to set text property of label which is in content page from javascript function. function empcodesize() { var size=document.getElementById('<%=TxtempCode.ClientID...
4
by: sunfeifei | last post by:
Your job is to write a C++ program that reads in a matrix and checks if it has the parity property. If not, your program should check if the parity property can be established by changing only one...
0
by: mohan21_kumar | last post by:
Hi, How to Send a Outlook Calendar Invite using ASP.Net with C#. Please suggest me how to go head in developing this or send me a sample code which would help me.
4
fayazmd
by: fayazmd | last post by:
I am working in a web application where i am sending mails to employees. I have to send mails to persons whose outlook out of office is set to false. And I need to know one's out of office status....
1
by: evenlater | last post by:
My client has asked for the ability to send email messages to a list of users by clicking a button on a form. This is a piece of cake to provide for our local users who have the Access...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.