IMAPIFolder::EmptyFolder
The EmptyFolder method deletes all messages and subfolders from a folder without deleting the folder itself.
Syntax
HRESULT EmptyFolder (
ULONG ulUIParam,
LPMAPIPROGRESS lpProgress,
ULONG ulFlags
);
Parameters
- ulUIParam
[in] Ignored. - lpProgress
[in] Ignored. - ulFlags
[in] Ignored.
Return Values
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_E_NO_SUPPORT
The method was called on a Search Folder. - MAPI_W_PARTIAL_COMPLETION
The method was called on the root folder of the message store, and it is possible that not all messages or subfolders were deleted. When this warning is returned, the call should be handled as successful.
Remarks
When EmptyFolder is unable to complete, do not assume that no work was done. EmptyFolder might have been able to delete some of the folder's contents before encountering the error.
EmptyFolder is not supported for Search Folders. If you attemtp to use it on one, it returns MAPI_E_NO_SUPPORT.
Use the DeleteFolder method if you want to ensure that subfolders that contain messages do not get deleted.
Requirements
Pocket PC: Windows Mobile Version 5.0 and later
Smartphone: Windows Mobile Version 5.0 and later
OS Versions: Windows CE 5.01 and later
Header: mapidefs.h
Library: cemapi.lib
See Also
IMAPIFolder | Windows Mobile Defined MAPI Properties | Messaging
Send Feedback on this topic to the authors