Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The DeleteMessagesmethod deletes one or more messages from the current folder.

Syntax

HRESULT DeleteMessages (
  LPENTRYLIST 
lpMsgList,
  ULONG 
ulUIParam,
  LPMAPIPROGRESS 
lpProgress,
  ULONG 
ulFlags
);

Parameters

lpMsgList

[in] Reference to an ENTRYLISTstructure that contains the number of messages to delete and an array of ENTRYIDstructures identifying the messages; cannot be NULL.

ulUIParam

[in] Ignored.

lpProgress

[in] Ignored.

ulFlags

[in] Ignored.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

S_OK

Indicates success.

MAPI_W_PARTIAL_COMPLETION

The call succeeded, but not all of the messages were successfully deleted. When this warning is returned, the call should be handled as successful.

Remarks

Messages that do not exist, that have been moved elsewhere, that are open with read/write access, or that are currently submitted cannot be deleted.

When DeleteMessagesis unable to complete, do not assume that no work was done. DeleteMessagesmight have been able to delete one or more of the messages before encountering the error.

Requirements

Header mapidefs.h
Library cemapi.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also

Reference

IMAPIFolder

Other Resources

Messaging