Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Update Method (Message Object)

Exchange Server 2003

Topic Last Modified: 2004-06-09

The Update method saves the message in the MAPI system.

objMessage.Update( [makePermanent] [, refreshObject] )

objMessage

Required. The Message object.

makePermanent

Optional. Boolean. A value of True indicates that the property cache is flushed and all changes are committed in the underlying message store. False indicates that the property cache is flushed but not committed to persistent storage. The default value is True.

refreshObject

Optional. Boolean. A value of True indicates that the property cache is reloaded from the values in the underlying message store. False indicates that the property cache is not reloaded. The default value is False.

Changes to a Message object are not permanently saved in the MAPI system until you either call the Update method with the makePermanent parameter set to True or call the Send method.

For improved performance, CDO caches property changes in private storage and updates either the object or the underlying persistent storage only when you explicitly request such an update. For efficiency, you should make only one call to Update with its makePermanent parameter set to True.

The makePermanent and refreshObject parameters combine to cause the following changes:

 

refreshObject = True

refreshObject = False

makePermanent = True

Commit all changes, flush the cache, and reload the cache from the message store.

Commit all changes and flush the cache (default combination).

makePermanent = False

Flush the cache and reload the cache from the message store.

Flush the cache.

Call Update(False, True) to flush the cache and then reload the values from the message store.

This code fragment changes the subject of the first message in the Inbox:

Set objMessage = objSession.Inbox.GetFirst
' ... verify message
objMessage.Subject = "This is the new subject"
objMessage.Update ' commit changes to MAPI system
 

To add a new Message object, use the Messages collections Add method followed by the messages Update method. This code fragment saves a new message in the Outbox:

Dim objMessage As Message ' Message object
'
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = "Microsoft CDO Library"
objMessage.Text = "The new version is now available."
objMessage.Update makePermanent:=True ' redundant parameter (default)
 
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.