IMAPIMessageSite::MoveMessage

Applies to: Outlook 2013 | Outlook 2016

Moves the current message to a folder.

HRESULT MoveMessage(
  LPFOLDER pFolderDestination,
  LPMAPIVIEWCONTEXT pViewContext,
  LPCRECT prcPosRect
);

Parameters

pFolderDestination

[in] A pointer to the folder where the message is to be moved.

pViewContext

[in] A pointer to a view context object.

prcPosRect

[in] A pointer to a RECT structure that contains the current form's window size and position. The next form displayed also uses this window rectangle.

Return value

S_OK

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

MAPI_E_NO_SUPPORT

The operation is not supported by this message site.

Remarks

Form objects call the IMAPIMessageSite::MoveMessage method to move the current message to a new folder.

Notes to implementers

A form viewer's implementation of MoveMessage must call the IMAPIViewContext::ActivateNext method, passing the VCDIR_MOVE flag, before actually moving the message to a new folder. To obtain the RECT structure used by a form's window, call the Windows GetWindowRect function.

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

Notes to callers

Following the return of MoveMessage, forms must check for a current message and then dismiss themselves if none exists.

MFCMAPI reference

For MFCMAPI sample code, see the following table.

File Function Comment
MyMAPIFormViewer.cpp
CMyMAPIFormViewer::MoveMessage
Not implemented.

See also

IMAPIViewContext::ActivateNext

IMAPIMessageSite : IUnknown

MFCMAPI as a Code Sample

MAPI Form Interfaces