PRB: CDO (1.x) Error MAPI_E_NOT_FOUND Setting Value of Property

Article translations Article translations
Article ID: 183094 - View products that this article applies to.
This article was previously published under Q183094
Expand all | Collapse all

On This Page

SYMPTOMS

When attempting to set the value of a field (property) of a Collaboration Data Objects (1.1, 1.2, 1.21) object, the following error may occur:
MAPI_E_NOT_FOUND.

CAUSE

The field probably does not yet exist in the underlying Messaging Application Programming Interface (MAPI) object.

RESOLUTION

Instead of just setting the field value, proceed from the assumption that the field does not exist. Use the Add method of the Fields collection, which facilitates both adding the field and setting the value as follows:
   objMsg.Fields.Add &H00150040, 234
				
The sample above demonstrates adding and setting the value for the PR_EXPIRY_LIMIT (&H00150040) field. No error occurs if the property already exists.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a message object called objMsg.
  2. Try to set a property not directly exposed by CDO (1.1, 1.2, 1.21) (such as PR_EXPIRY_LIMIT (&H00150040)):
          objMsg.Fields(&H00150040) = 234
    					
  3. Note that the above statement fails with this error:
    MAPI_E_NOT_FOUND.

Properties

Article ID: 183094 - Last Review: June 6, 2005 - Revision: 3.0
APPLIES TO
  • Microsoft Collaboration Data Objects 1.1
  • Microsoft Collaboration Data Objects 1.2
  • Microsoft Collaboration Data Objects 1.21
Keywords: 
kberrmsg kbmsg kbprb KB183094
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com