The IMAPIProp::SetProps method updates one or more properties.
See IMAPIProp : IUnknown.
HRESULT SetProps(
ULONG cValues,
LPSPropValue lpPropArray,
LPSPropProblemArray FAR * lppProblems
);
The following values can be returned in the SPropProblemArray structure, but not as return values for SetProps:
Ignore the PR_NULL property tag and all properties with a type of PT_ERROR; make no changes and report no problems in the SPropProblemArray structure.
Return MAPI_E_INVALID_PARAMETER if a property of type PT_OBJECT is included in the property value array. Also return this error if a multivalued property is included in the array and its cValues member is set to zero.
If the call succeeds overall but there are problems with setting some of the properties, return S_OK and place information about the problems in the appropriate entry of the SPropProblemArray structure pointed to by the lppProblems parameter.
Depending on the service provider, you might also be able to change the property type by passing a property tag containing a different type than was previously used with a given property identifier.
If you include a property tag for a property that is unsupported by the object and the implementation of SetProps allows the creation of new properties, the property is added to the object. Any previous value stored with the property identifier used for the new property is discarded.
Note that the S_OK return value does not guarantee that all of the properties were successfully updated. Some providers cache SetProps calls until they receive a call that requires provider intervention, such as IMAPIProp::SaveChanges or IMAPIProp::GetProps. Therefore, it is possible to receive error values relating to the SetProps call with the later calls.
If SetProps returns S_OK, check the SPropProblemArray structure pointed to by lppProblems for problems updating individual properties. If SetProps returns an error, do not check the property problem array. Instead, call the object's IMAPIProp::GetLastError method.
When updating large properties, SetProps can fail and return MAPI_E_NOT_ENOUGH_MEMORY. There is no maximum size for properties, and different objects can have different limits. If you deal with potentially large properties be prepared to call IMAPIProp::OpenProperty with IID_IStream as the interface identifier if SetProps returns this error value.
Call the MAPIFreeBuffer function to free the SPropProblemArray structure.
IMAPIProp::GetProps, IMAPIProp::SaveChanges, MAPIFreeBuffer, SPropProblemArray, SPropValue