MAPIDeleteMail (VB)

The Visual Basic MAPIDeleteMail function deletes a message.

Quick Info

Header file:

MAPIVB32.BAS

 

MAPIDeleteMail(

    Session as Long,
    UIParam as Long,
    MessageID as String,
    Flags as Long,
    Reserved as Long) as Long

 

Parameters

Session

[in] Session handle that represents a valid Simple MAPI session. The value of the Session parameter cannot be zero.

UIParam

[in] Parent window handle or zero, indicating that if a dialog box is displayed, it is application modal. If no dialog box is displayed during the call, the UIParam parameter is ignored.

MessageID

[in] Identifier for the message to be deleted. This string identifier is messaging system-specific and will be invalid when the MAPIDeleteMail function successfully returns. Both the MAPIFindNext4WTQKI and MAPISaveMail1K1.O15 functions return message identifiers.

Flags

Reserved; must be zero.

Reserved

Reserved; must be zero.

 

Return Values

MAPI_E_FAILURE

One or more unspecified errors occurred while deleting the message. No message was deleted.

MAPI_E_INSUFFICIENT_MEMORY

There was insufficient memory to proceed. No message was deleted.

MAPI_E_INVALID_MESSAGE

An invalid message identifier was passed in for the MessageID parameter. No message was deleted.

MAPI_E_INVALID_SESSION

An invalid session handle was passed in for the Session parameter. No message was deleted.

SUCCESS_SUCCESS

The call succeeded and the message was deleted.

 

Remarks

To find the message to be deleted, call the MAPIFindNext4WTQKI function before calling MAPIDeleteMail.

The declaration of this function for the 32-bit Visual Basic runtime is:

MAPIDeleteMail(

ByVal Session&,
ByVal UIParam&,
ByVal MsgID$,
ByVal Flags&,
ByVal Reserved&) As Long