Platform SDK: MAPI |
The IPropData::HrAddObjProps method adds one or more properties that are of type PT_OBJECT to the object.
HRESULT HrAddObjProps( LPSPropTagArray lpPropTagArray, LPSPropProblemArray FAR * lppProblems );
The IPropData::HrAddObjProps method adds one or more properties that are type PT_OBJECT to the object. HrAddObjProps provides an alternative to IMAPIProp::SetProps for object properties because object properties cannot be created by calling SetProps. Adding an object property results in the property tag being included in the list of property tags retrieved through IMAPIProp::GetPropList.
If HrAddObjProps returns MAPI_W_PARTIAL_COMPLETION and you have set lppProblems to a valid pointer, check the returned SPropProblemArray structure to find out which properties were not added. Typically, the only problem that occurs is lack of memory. Free the SPropProblemArray structure by calling the MAPIFreeBuffer function when you are finished with it.
To add a property, the target object must have read/write access. If HrAddObjProps returns MAPI_E_NO_ACCESS, this indicates that you cannot add properties to the object because it does not permit modification. To obtain read/write access to an object prior to calling HrAddObjProps, call IPropData::HrSetObjAccess and set the ulAccess parameter to IPROP_READWRITE.