FolderID Property (Message Object)

The FolderID property returns the unique identifier of the folder in which the message resides. Read-only.

Syntax

objMessage.FolderID

Data Type

String

Remarks

Save the folder identifier to retrieve the Folder object at a later time using the Session object's GetFolder method.

MAPI assigns a permanent, unique identifier when an object is created. This identifier does not change from one MAPI session to another, nor from one messaging domain to another. However, MAPI does not require identifier values to be binary comparable. Accordingly, two identifier values can be different, yet refer to the same object. MAPI compares identifiers with the CompareEntryIDs method. CDO provides the CompareIDs method in the Session object. For more information on entry identifiers, see the MAPI Programmer's Reference.

A Microsoft® Schedule+ calendar folder does not have a MAPI identifier. If you obtain the Schedule+ default calendar folder by passing CdoDefaultFolderCalendar to the Session object's GetDefaultFolder method, the folder's AppointmentItem objects have no defined value for the FolderID property. An attempt to access FolderID in this case returns CdoE_NOT_FOUND.

The FolderID property corresponds to the MAPI property PR_PARENT_ENTRYID, converted to a string of hexadecimal characters. It can be rendered into HTML hypertext using the CDO Rendering ObjectRenderer object. To specify this, set the object renderer's DataSource property to this Message object and the property parameter of the RenderProperty method to CdoPR_PARENT_ENTRYID.