Share via


IMAPIMessageSite::MoveMessage

Applies to: Office 2010 | Outlook 2010 | Visual Studio

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
);

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

Reference

IMAPIViewContext::ActivateNext

IMAPIMessageSite : IUnknown

Concepts

MFCMAPI as a Code Sample

MAPI Form Interfaces