IMessage::DeleteAttach

The IMessage::DeleteAttach method deletes an attachment.

Quick Info

See IMessage : IMAPIProp.

HRESULT DeleteAttach(
  ULONG ulAttachmentNum,   
  ULONG ulUIParam,         
  LPMAPIPROGRESS lpProgress,   
  ULONG ulFlags            
);
 

Parameters

ulAttachmentNum
[in] Index number of the attachment to delete. This is the value for the attachment's PR_ATTACH_NUM property.
ulUIParam
[in] Handle of the parent window for any dialog boxes or windows this method displays. The ulUIParam parameter is ignored unless the ATTACH_DIALOG flag is set in the ulFlags parameter.
lpProgress
[in] Pointer to a progress object for displaying a progress indicator. If NULL is passed in lpProgress, the message store provider displays a progress indicator using the MAPI progress object implementation. The lpProgress parameter is ignored unless the ATTACH_DIALOG flag is set in ulFlags.
ulFlags
[in] Bitmask of flags that controls the display of a user interface. The following flag can be set:
ATTACH_DIALOG
Requests the display of a progress indicator as the operation proceeds.

Return Value

S_OK
The attachment was successfully deleted.

Remarks

The IMessage::DeleteAttach method deletes an attachment from within a message.

A deleted attachment is not permanently deleted until the message's IMAPIProp::SaveChanges method has been called.

Notes to Callers

Before calling DeleteAttach, call the IUnknown::Release method for the attachment and each of its streams.

Because deleting an attachment can be a lengthy process, DeleteAttach provides the mechanism for displaying a progress indicator. You can request the display of a progress indicator by passing a pointer to your IMAPIProgress : IUnknown implementation or NULL if you do not have an implementation. You must also specify a window handle in the ulUIParam parameter and the ATTACH_DIALOG flag in the ulFlags parameter.

See Also

IMAPIProp::SaveChanges