Background on MAPI-based Entry IDs
When Outlook saves an item in a folder, the item is assigned an Entry ID value by the store in which the item resides. Examples of stores are a Microsoft Exchange Server mailbox, the Exchange Server public folder store, and a personal folders (.pst) file.
Entry IDs are guaranteed to be unique within a store. However, Entry IDs can change under certain scenarios. These scenarios include when an item is moved to a different folder or to a different store. Entry IDs can also change when a user performs certain functions in Outlook. These functions include exporting and then reimporting data. The new approach to processing calendar items in Outlook 2003 SP2 and later service packs and in Exchange Server 2003 SP2 is another example of when an Entry ID can change.
For more information about Entry IDs, visit the following MSDN Web site:
There are various APIs that support working with Entry IDs. These APIs include Extended MAPI, the CDO 1.21 object library, and the Outlook object library.
How this new design may affect solutions
Some solutions that integrate with Outlook keep track of Outlook data in an external database. Other solutions may use custom Outlook forms to store the Entry ID of one item as a field on another item to provide linking functionality. In these scenarios, you can use approaches such as the
GetItemFromID method in the Outlook object library to directly access an item based on its Entry ID.
However, using an Entry ID to locate an item may become unreliable after SP2 or a later service pack is installed. Therefore, you have the following options:
- Update your code to account for the fact that the Entry ID for a calendar item will change.
- Use the Global Object ID. This is an identifier that stays the same throughout the lifetime of the calendar item.
As a developer, you should take this new design in Outlook behavior into account when you design or update a custom solution that integrates with Outlook calendaring.
Global Object ID
The Global Object ID is a MAPI property that Outlook uses to match meeting updates and responses with a particular meeting on the calendar. The Global Object ID is the same across all copies of the calendar item. In Microsoft Office Outlook 2003 Service Pack 1 (SP1) and earlier versions, the Global Object ID is generated when an organizer first sends a meeting request. Therefore, these earlier versions of Outlook do not generate a Global Object ID for unsent meetings or for appointments that have no recipients.
In Outlook 2003 SP2 or in later versions of Office, the Global Object ID is generated when a user first saves a calendar item, regardless of whether it is sent. Therefore, starting with Outlook 2003 SP2 or a later service pack, all appointments will have a Global Object ID, regardless of whether they are meetings to which other users have been invited.
To access the Global Object ID programmatically, use the following information.
Property Set Tag (Namespace)
GUID = {6ED8DA90-450B-101B-98DA-00AA003F1305}
Named Property ID: 3
The Outlook object library has not been updated to expose this property. The following samples are code samples that illustrate how to access the Global Object ID on an appointment item by using the CDO 1.21 object library or Extended MAPI (requires C++).
CDO 1.21'Note that you must add a reference to �Microsoft CDO 1.21 Library� (CDO.DLL) to run this code
Dim objCDO As MAPI.Session
Dim objAppt As MAPI.Message
Dim oAppt As Outlook.AppointmentItem
Dim objFields As MAPI.Fields
Dim Value
Dim propSet As String
Set objCDO = CreateObject("MAPI.Session")
objCDO.Logon "", "", False, False
'Assumes that active inspector is a calendar item
Set oAppt = objCDO.GetDefaultFolder(0).Messages.GetFirst()
'Use EntryID to get CDO Message
Set objAppt = objCDO.GetMessage(oAppt.EntryID)
'http://support.microsoft.com/?kbid=195656 says to swap around the GUID
'propSet = "6ED8DA90450B101B98DA00AA003F1305" '<-GUID we think we should be using
propSet = "90DAD86E0B451B1098DA00AA003F1305" '<-GUID that will really work
Set objFields = objAppt.Fields
Value = objFields.Item("0x0003", propSet).Value
MsgBox Value
Extended MAPIDEFINE_GUID(PSETID_Meeting,
0x6ED8DA90,0x450B,0x101B,0x98,0xDA,0x00,0xAA,0x00,0x3F,0x13,0x05);
#define LID_GLOBAL_OBJID 3
// This code assumes that lpMsg is an LPMESSAGE
HRESULT hr = S_OK;
ULONG ulVal = 0;
LPSPropValue lpPropVal = NULL;
LPSPropTagArray lpNamedPropTag = NULL;
MAPINAMEID NamedID = {0};
LPMAPINAMEID lpNamedID = NULL;
// Set up the request to GetIDsFromNames.
NamedID.lpguid = (LPGUID) &PSETID_Meeting;
NamedID.ulKind = MNID_ID;
NamedID.Kind.lID = LID_GLOBAL_OBJID;
lpNamedID = &NamedID;
// Find the prop tag
hr = lpMsg->GetIDsFromNames(1, &lpNamedID, NULL, &lpNamedPropTag);
// Set our type to binary
lpNamedPropTag->aulPropTag[0] =
CHANGE_PROP_TYPE(lpNamedPropTag->aulPropTag[0],PT_BINARY);
// Get the value of the property.
hr = lpMsg->GetProps(lpNamedPropTag ,0, &ulVal, &lpPropVal);
// Do something with the ID here
// Cleanup
MAPIFreeBuffer(lpPropVal);
MAPIFreeBuffer(lpNamedPropTag);
Specifics about the CDO 1.21 object library
The CDO 1.21 object library was updated to process appointments based on this new design. The design change is included in the server-side CDO.DLL that is included with Exchange Server 2003 SP2. The client-side version of CDO.DLL is installed by Outlook or by Microsoft Office. The first client-side version to include this change is the CDO.DLL that is installed by Microsoft Office 2003 SP2.
Specifics about the CDOEX object library
The CDOEX object library was updated to process new appointments based on this new design. CDOEX can be used only on an Exchange server. Additionally, the updated CDOEX.DLL is included in Exchange Server 2003 SP2.
Specifics about the Outlook object library
The Outlook object library provides the new functionality, starting with Office Outlook 2003 SP2 or later. This change is also included in later versions of Outlook.
Specifics about Extended MAPI
Although you can access Entry IDs by using Extended MAPI, using Extended MAPI to work with appointments is not supported.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
266353�
Outlook named properties are not supported by MAPI or CDO