Published: July 16, 2012
Updates one or more properties.
Ignore the PR_NULL (PidTagNull) property tag and all properties with a type of PT_ERROR. Do not make changes or report 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 multiple-value property is included in the array and its cValues member is set to 0.
If the call succeeds overall but there are problems with setting some of the properties, return S_OK and put information about the problems in the appropriate entry of the SPropProblemArray structure that the lppProblems parameter points to.
Depending on the service provider, you might also be able to change the property type by passing a property tag that contains 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 that was 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 that relate 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 the IMAPIProp::OpenProperty method with IID_IStream as the interface identifier if SetProps returns this error value.
Call the MAPIFreeBuffer function to free the SPropProblemArray structure.