Last modified: July 23, 2011
Applies to: Outlook
Adds one or more properties of type PT_OBJECT to the object.
The IPropData::HrAddObjProps method adds one or more properties of type PT_OBJECT to the object. HrAddObjProps provides an alternative to the IMAPIProp::SetProps method 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 that the IMAPIProp::GetPropList method returns.
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 permission. If HrAddObjProps returns MAPI_E_NO_ACCESS, you cannot add properties to the object because it does not permit modification. To obtain read/write permission to an object prior to calling HrAddObjProps, call IPropData::HrSetObjAccess and set the ulAccess parameter to IPROP_READWRITE.