3.1.4.8 Deleting the Contents of a Folder

To delete all messages and subfolders from a folder without deleting the folder itself, the client sends either a RopEmptyFolder ROP request ([MS-OXCROPS] section 2.2.4.9) or a RopHardDeleteMessagesAndSubfolders ROP request ([MS-OXCROPS] section 2.2.4.10). The client uses the RopEmptyFolder ROP for a soft delete and the RopHardDeleteMessagesAndSubfolders ROP for a hard delete. A message that has been soft deleted can be recovered only by opening it, copying its contents to a new message, and then saving the new message. For details about opening and saving a Message object, see [MS-OXCMSG]. For details about copying a Message object from one folder to another, see section 3.1.4.7.

To remove particular messages from a folder, the client sends either a RopDeleteMessages ROP request ([MS-OXCROPS] section 2.2.4.11) or a RopHardDeleteMessages ROP request ([MS-OXCROPS] section 2.2.4.12). The client uses RopDeleteMessages for a soft delete and RopHardDeleteMessages for a hard delete.

The RopEmptyFolder ROP request, RopHardDeleteMessagesAndSubfolders ROP request, RopDeleteMessages ROP request, and RopHardDeleteMessages ROP request are processed asynchronously if the client sets the WantAsynchronous field of the request to nonzero (TRUE), as specified in sections 2.2.1.9.1, 2.2.1.10.1, 2.2.1.11.1, and 2.2.1.12.1. For details about asynchronous processing, see section 3.1.5.2.