Item Property
Returns a Mailbox
object from the collection.
Index parameter specifies the index of the mailbox in the collection.
If Index is out of range, automation error occurs.
Item is the default property of the collection. The following two statements
(assuming Mailboxes has MailBee.Mailboxes type) are equivalent:
Set Mailbox = Mailboxes(1)
and
Set Mailbox = Mailboxes.Item(1)
Value Type: | MailBee.Mailbox | |
Parameters: | ||
Index As Long | Index of the mailbox to return. Allowed range is: 1 <= Index <= Mailboxes.Count | |
Remarks: | This property is read-only |
Usage example:
' This sample prints the name of the first mailbox in the IMAP4 account Dim Mailer, Mailboxes 'Using visual basic to create object Set Mailer = CreateObject("MailBee.IMAP4") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.IMAP4") 'In ASP use Response.Write instead of MsgBox Mailer.EnableLogging = True Mailer.LogFilePath = "C:\Temp\imap4_log.txt" Mailer.ClearLog Mailer.LicenseKey = "put your license key here" If Mailer.Connect("mailserver.com", 143, "MyName", "MyPassword") Then Set Mailboxes = Mailer.RetrieveMailboxes If Not Mailboxes Is Nothing Then If Mailboxes.Count > 0 Then MsgBox "First mailbox name: " & Mailboxes(1).Name ' Using Item as Default property End If End If Mailer.Disconnect End If
See Also:
Count
Property
Mailbox Object
Mailboxes Collection
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.