Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic


Closes a message session and all the messages created within that session.

Header file:


Implemented by:


Called by:

Client applications and service providers

VOID CloseIMsgSession(



[in] Pointer to the message session object obtained using the OpenIMsgSession function at the start of the message session.

A message session is used by client applications and service providers that want to deal with several related MAPI IMessage objects built on top of underlying OLE IStorage objects. The client or provider uses the OpenIMsgSession and CloseIMsgSession functions to wrap the creation of such messages inside a message session. Once the message session is opened, the client or provider passes a pointer to it in a call to OpenIMsgOnIStg to create a new IMessage-on-IStorage object.

A message session keeps track of all IMessage-on-IStorage objects opened during the duration of the session, in addition to all the attachments and other properties of the messages. When a client or provider calls CloseIMsgSession, it closes all these objects. Calling CloseIMsgSession is the only way to close IMessage-on-IStorage objects.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.