Mailbox Object : Get Method |
Visual Basic |
---|
Public Sub Get( _ Optional ByVal Part As GetConstants = imapGetContent, _ Optional ByVal MsgSet As String, _ Optional ByRef Msg As Variant _ ) |
Value | Description |
---|---|
imapGetContent | Requests retrieval of the complete message for each message in MsgSet. |
imapGetFlags | Requests the flags for each message specified in MsgSet. |
imapGetHeaders | Requests the retrieval of the header fields for each message in the MsgSet. |
imapGetPreview | Requests the retrieval of the header fields plus parts information for each message in the MsgSet. |
imapGetSize | Requests the size for each message specified in MsgSet. |
imapGetUid | Requests the message UID label for each message in MsgSet. |
This method makes it easy to download any or all parts of a set of messages. The default destination for messages is the Messages property.
If provided, MsgSet specifies one or more message numbers in the range from 1 to Count. Each number should be separated with a comma. A range of numbers may be indicated with a lower and upper number separated with a colon. For example, a message set of "1, 5:7, 12" will retrieve 5 messages: 1, 5, 6, 7, and 12.
If the destination is the Messages Collection, this method creates all required Message Objects. If a Message Object exists with the same Attribute property, it is reused. Therefore, you can first get the Size of messages causing creation of a Message Object for each message. Getting the imapGetContent will reuse the Message Objects previously created.
If Msg is specified, MsgSet must reference a single message. If Msg is a buffer and Timeout is 0 (non-blocking), Msg must not go out of scope while the operation completes (the Msg String or Byte array must be global in scope).
This method may generate the following error code (refer to MailErrorConstants for a complete list of error codes):