This documentation is archived and is not being maintained.


This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Sets or alters attributes of properties on an IMessage object supplied by the OpenIMsgOnIStg function.

Header file:


Implemented by:


Called by:

Client applications and message store providers

HRESULT SetAttribIMsgOnIStg(
  LPVOID lpObject,
  LPSPropTagArray lpPropTags,
  LPSPropAttrArray lpPropAttrs,
  LPSPropProblemArray FAR * lppPropProblems


[in] Pointer to the object for which property attributes are being set.


[in] Pointer to an SPropTagArray structure containing an array of property tags indicating the properties for which property attributes are being set.


[in] Pointer to an SPropAttrArray structure listing the property attributes to set.


[out] Pointer to the returned SPropProblemArray structure containing a set of property problems. This structure identifies problems encountered if SetAttribIMsgOnIStg has been able to set some properties, but not all. If a pointer to NULL is passed in the lppPropProblems parameter, no property problem array is returned even if some properties were not set.


The call succeeded and has returned the expected value or values.


The call succeeded overall, but one or more properties could not be accessed and were returned with a property type of PT_ERROR.

Property attributes can only be accessed on property objects, that is, objects implementing the IMAPIProp : IUnknown interface. To make MAPI properties available on an OLE structured storage object, OpenIMsgOnIStg builds an IMessage : IMAPIProp object on top of the OLE IStorage object. The property attributes on such objects can be set or altered with SetAttribIMsgOnIStg and retrieved with GetAttribIMsgOnIStg.

Note  GetAttribIMsgOnIStg and SetAttribIMsgOnIStg do not operate on all IMessage objects. They are only valid for IMessage-on-IStorage objects returned by OpenIMsgOnIStg.

In the lpPropAttrs parameter, the number and position of the attributes must match the number and position of the property tags passed in the lpPropTags parameter.

The SetAttribIMsgOnIStg function is used to make message properties read-only when required by the IMessage schema. The sample message store provider uses it for this purpose. For more information, see Messages.