IMAPIMessageSite::GetSession

Applies to: Outlook 2013 | Outlook 2016

Returns the MAPI session in which the current message was created or opened.

HRESULT GetSession(
  LPMAPISESSION FAR * ppSession
);

Parameters

ppSession

[out] A pointer to a pointer to the returned session object.

Return value

S_OK

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

S_FALSE

No session exists for the current message.

Remarks

For a list of interfaces that are related to form servers, see MAPI Form Interfaces.

MFCMAPI reference

For MFCMAPI sample code, see the following table.

File Function Comment
MyMAPIFormViewer.cpp
CMyMAPIFormViewer::GetSession
MFCMAPI uses the IMAPIMessageSite::GetSession method to return the currently cached session pointer, if it is available.

See also

IMAPIMessageSite : IUnknown

MFCMAPI as a Code Sample