IMAPIFolder::EmptyFolder
Published: July 16, 2012
Deletes all messages and subfolders from a folder without deleting the folder itself.
HRESULT EmptyFolder( ULONG_PTR ulUIParam, LPMAPIPROGRESS lpProgress, ULONG ulFlags );
The IMAPIFolder::EmptyFolder method deletes all of a folder's contents without deleting the folder itself.
During an EmptyFolder call, submitted messages are not deleted.
A folder's associated contents include messages that are used to describe views, rules, custom forms, and custom solution storage, and can also include form definitions.
Do not call the IMsgStore::AbortSubmit method for messages in the folder that have been submitted. Submitted messages are not deleted.
Expect these return values under the following conditions.
|
Condition |
Return value |
|---|---|
|
EmptyFolder has successfully emptied the folder. |
S_OK |
|
EmptyFolder was unable to completely empty the folder. |
MAPI_W_PARTIAL_COMPLETION |
|
EmptyFolder was unable to complete. |
Any error value |
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.