Microsoft KB Archive/183094

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

Article ID: 183094

Article Last Modified on 6/6/2005

-

APPLIES TO


 * Microsoft Collaboration Data Objects 1.1
 * Microsoft Collaboration Data Objects 1.2
 * Microsoft Collaboration Data Objects 1.21

-



This article was previously published under Q183094



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.



Steps to Reproduce Behavior
 Create a message object called objMsg.  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  Note that the above statement fails with this error:

MAPI_E_NOT_FOUND.



Keywords: kberrmsg kbmsg kbprb KB183094

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.