Imap Object : Refresh Method |
This method may generate the following error code (refer to MailErrorConstants for a complete list of error codes):
Private Sub Command1_Click() On Error GoTo OnError ' use intrinsic error handling Dim Mailbox As Mailbox Imap1.Login "imap.test.com", "user", "pass" ' Get new listing from the server. The collection will be ' cleared and repopulated. Imap1.Refresh ' Display all mailboxes returned in the listing For Each Mailbox In Imap1.Mailboxes List1.AddItem Mailbox.Name Next Exit Sub OnError: ' Any error jumps here Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub