wodMailbox ActiveX Control - Attachments Property
      
 

Description

References collection of attachments for the message.


Property type

An Attachments object.  


Syntax

object.Attachments



The Attachments Property syntax has these parts:

Part Description
object An expression evaluating to an object of type Message.

Remarks

Attachments property is used to enumerate and access all the attachments contained in the message.

Actually, this is just a wrapper - no real objects are made for Attachments collection. It is here only to simplify your work with attachments, because attached files are actually stored in subparts of the message. So, when you access Attachments collection, and try to get, for example, it's Count value, wodMailbox will loop through all subparts and will try to find if in any of them is attached file. If such file is found, information about it will be updates in Attachments collection so you can easily save it, get it's filename or type, etc..

One thing pretty important here is to cache all the information gathered by looping through subparts - at all times. This means, for instance, when Count is read, wodMailbox will find total count of attachments and cache it. This also applies to all other information, such as filename. If you are not interested in some of attachments, wodMailbox will not even access it, thus no memory will be used to storing information about it.

There's one nice thing in this approach. When there's attachment in your message, you will be able to access it using two approaches: as a message part, or as attachment object.

If you access it as a message part, you will see that message part contains readable data that represents encoded file. You can also access headers and locate ones you're interested in, such as encoding type, size, or any additional information.

If you access it as an attachment, wodMailbox will collect all needed information for you, and will allow you to automatically save it.

It's up to you to decide which approach you will use. Why not both, if needed?