Visual Basic: MAPI Controls
Sets the currently indexed attachment. This property is not available at design time.
object.AttachmentIndex [ = value ]
The AttachmentIndex property syntax has these parts:
|object||An object expression that evaluates to an object in the Applies To list.|
|value||A long expression specifying the currently indexed attachment.|
Specifies an index number to identify a particular message attachment. The index number in this property determines the values in the AttachmentName, AttachmentPathName, AttachmentPosition, and AttachmentType properties. The attachment identified by the AttachmentIndex property is called the currently indexed attachment. The value of AttachmentIndex can range from 0 (the default) to AttachmentCount -1.
To add a new attachment, set the AttachmentIndex to a value greater than or equal to the current attachment count while in the compose buffer (MsgIndex = -1). The AttachmentCount property is updated automatically to reflect the implied new number of attachments.
For example, if the current AttachmentCount property has the value 3, setting the AttachmentIndex property to 4 adds 2 new attachments and increases the AttachmentCount property to 5.
To delete an existing attachment, specify the Delete method with the value parameter set to 2. Attachments can be added or deleted only when the MsgIndex property is set to -1.