Remove Method

Applies To

Actions collection object, Attachments collection object, Folders collection object, Items collection object, Pages collection object, Recipients collection object, UserProperties collection object.

Description

Removes the object from the collection.

Syntax

expression.Remove(Index)

expression An expression that returns an object in the Applies To list.

Index Required Long. The index of the object within the collection.

Example

This example removes all attachments from a forwarded message before sending it on to John Y. Chen.

Set myItem = myOlApp.ActiveInspector.CurrentItem.Forward
Set myAttachments = myItem.Attachments
While myAttachments.Count > 0
    myAttachments.Remove 1
Wend
myItem.Recipients.Add "John Y. Chen"
myItem.Send