BodyPartStructures Collection
The BodyPartStructures
collection contains BodyPartStructure
objects which organize the structure of the multipart
MIME part.
The BodyPartStructures collection can be obtained via SubParts
property of the multipart BodyPartStructure object. Multipart BodyPartStructure
objects have IsMultipart property set to True. The BodyPartStructures
collection is recursive since contained BodyPartStructure objects can
also be multipart and thus can expose their own BodyPartStructures collections.
Syntax
BodyPartStructures.property
Properties | |
Count | Returns the number of BodyPartStructure objects in the collection. |
Item | Returns a reference to BodyPartStructure object in the collection. |
Remarks
Note:
A simple e-mail message can have a single MIME part only, thus all its structure
is represented by a single BodyPartStructure object. The BodyPartStructures
collection is not available for single MIME part messages.
Item is the default property of the collection, so BodyPartStructures.Item(index)
and BodyPartStructures(index) are equivalents.
To iterate through the collection, you can use either For .. Each
statement or any common loop statement such as For .. To.
Example
The following examples use different syntax to display grouping status (whether multipart or not) of the body parts. It's assumed the BodyPartStructures collection has been already obtained through SubParts property of the BodyPartStructure object, and stored in objBodyPartStructures variable.For Each objBodyPartStructure In objBodyPartStructures
MsgBox objBodyPartStructure.IsMultipart
' In ASP, use Response.Write instead of MsgBox
Next
For .. To syntax
For I = 1 To objBodyPartStructures.Count
MsgBox objBodyPartStructures(I).IsMultipart
' In ASP, use Response.Write instead of MsgBox
Next
See Also