The IMAPIProp::GetIDsFromNames method provides the property identifiers that correspond to one or more property names.
See IMAPIProp : IUnknown.
HRESULT GetIDsFromNames(
ULONG cPropNames,
LPMAPINAMEID FAR * lppPropNames,
ULONG ulFlags,
LPSPropTagArray FAR * lppPropTags
);
The IMAPIProp::GetIDsFromNames method retrieves an array of property tags that hold the property identifiers for one or more named properties. IMAPIProp::GetIDsFromNames can be called to:
Named properties are commonly used by message store providers for folders and messages. Other objects, such as messaging users and profile sections, might not support the association of names to property identifiers and return MAPI_E_NO_SUPPORT from GetIDsFromNames.
If there is an error returning an identifier for a particular name, GetIDsFromNames returns MAPI_W_ERRORS_RETURNED and sets the property type in the property tag array entry that corresponds to the name to PT_ERROR and the identifier to zero.
Name-to-identifier mapping is represented by an object's PR_MAPPING_SIGNATURE property. PR_MAPPING_SIGNATURE contains a MAPIUID structure that indicates the service provider responsible for the object. If the PR_MAPPING_SIGNATURE property is the same for two objects, assume that these objects use the same name-to-identifier mapping.
The identifiers that you pass back in the property tag array pointed to by lppPropNames must be in the 0x8000 to 0xFFFE range. The entries in this array must be in the same order as the names passed in the property name array pointed to by lppPropNames.
If you support named properties on a container, use the same name-to-identifier mapping for all objects in your container. That is, do not use a different mapping for each folder in your message store or each message in your folder.
Because the property types for the returned identifiers in the property tag array pointed to by lppPropTags are set to PT_UNSPECIFIED, you will need to call IMAPIProp::SetProps to retrieve the accurate types.
If you move or copy objects with named properties, and the source and destination objects have different mapping signatures as indicated by the values of their PR_MAPPING_SIGNATURE properties, you must preserve the names during these operations. To preserve property names, adjust the corresponding property identifiers to match the name-to-identifier mapping of the destination object.
Some objects have a limit as to the number of property identifiers they can name. If a call to GetIDsFromNames causes this limit to be exceeded, the method returns MAPI_E_TOO_BIG. In this case, query by identifier.
For more information, see Named Properties.
IMAPIProp::GetNamesFromIDs, MAPINAMEID, MAPIUID