ItemDelete()

Deletes an item from the Mailbox or Sent Items.

Token ID

AFTKN_ITEM_DELETE or 695

Syntax

VOID ItemDelete([ANSISTRING MessageID]; 
                 [ENUM EmptyItem]; 
                 [DWORD FolderListHandle]; 
                 [ENUM AllInstances]; 
                 [ENUM Retract])

Parameters

MessageID As ANSISTRING

(Optional) Unique item identifier, returned by ItemMessageIDFromView(). If not specified, deletes the selected item. If specified, you must also specify EmptyItem.

EmptyItem As ENUM

(Optional) Do not place deleted items in the trash:

  • 0 No (Default)
  • 1 Yes
FolderListHandle As DWORD

(Optional) Handle of a folder list. If not specified, deletes the item from all folders. Handle is returned in a variable by FolderListCreate() or FolderListCreateFromView().

AllInstances As ENUM

(Optional) Deletes all instances of autodate item:

  • 0 No (Default)
  • 1 Yes
Retract As ENUM

(Optional) Retracts a Sent Items item:

292

AllBoxes

291

AllInBoxes

290

ThisOutbox

Remarks

IMPORTANT: EmptyItem ENUM always places any selected or opened Mailbox or Sent Items in the trash. If MessageID is used, UNUM Yes/1 does not put the item in the trash. AllInstances and Retract parameters have problems with selected items in that it prompts or ignores specified parameter enumerations if a MessageID is not used.