IMAPIMessageSite::MoveMessage

Last modified: July 23, 2011

Applies to: Outlook

In this article
Notes to Implementers
Notes to Callers
MFCMAPI Reference

Moves the current message to a folder.

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

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.

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.

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

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.

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

For MFCMAPI sample code, see the following table.

File

Function

Comment

MyMAPIFormViewer.cpp

CMyMAPIFormViewer::MoveMessage

Not implemented.

Show: