ID: Q195656
The information in this article applies to:
When you access custom properties with Collaboration Data Objects (CDO), you may receive an error of MAPI_E_NOT_FOUND when you use the third syntax listed in the help for the Fields.Item help:
objFieldsColl.Item(name [, propsetID] )
This problem is caused by the way in which CDO converts the PropSetID you input from a string to a Global Unique Identifier (GUID). CDO uses the FBinFromHex() function to convert the input string to a binary array and then casts it to a GUID. The GUID structure looks like {ULONG, ULONG, USHORT, char[8]}. When the byte array is cast to this GUID structure, the ULONG and USHORT byte values are in reverse order due to the Little-Endian byte order on x86 architecture machines. The char[] portion is fine because a byte[] array has the same structure as a char[].
When inputing the PropSetID, exchange the following positions:
For example, if your GUID is as follows:
0123456789ABCDEFxxxxxxxxxxxxxxxx
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16
-- -- -- -- --- --- --- --- --- ---- ---- ---- ---- ---- ---- ---
0 1 2 3 4 5 6 7 8 9 A B C D E F
For the PropSetID parameter, you need to rearrange and input the GUID as
follows:
67452301AB89EFCDxxxxxxxxxxxxxxxx
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16
-- -- -- -- -- -- -- -- -- --- --- --- --- --- --- ---
6 7 4 5 2 3 0 1 A B 8 9 E F C D
If your custom property is named "Property" and your GUID is
"0123456789ABCDEFxxxxxxxxxxxxxxxx", the code to access the property would
be as follows:
oMessage.oFields.Item("Property", "67452301AB89EFCDxxxxxxxxxxxxxxxx")
If rather than a name, the custom property had an ID of 33026, the ID would
need to be converted to hexadecimal and put in the form "0x8102", then use
it in the code as in the following example:
oMessage.oFields.Item("0x8102", "67452301AB89EFCDxxxxxxxxxxxxxxxx")
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Custom properties are properties that Messaging Application Programming Interface (MAPI) allows you to create by giving a GUID and either a name or number. This allows you to create your own virtual namespace of property identifiers that are unique from those that someone else might create.
Platform Software Development Kit; search on: "Using Named Properties"
Additional query words:
Keywords : kbole kbCDO kbCDO100a kbCDO110 kbCDO120 kbCDO121 kbMsg
Version : WINDOWS:1.0a,1.1,1.2,1.21
Platform : WINDOWS
Issue type : kbbug
Solution Type : kbnofix
Last Reviewed: November 19, 1998