Mailbox Object : Copy Method |
Visual Basic |
---|
Public Sub Copy( _ ByVal Destination As String, _ Optional ByVal MsgSet As String _ ) |
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 MsgSet As String ' Copy All Messages from INBOX to the OldMail mailbox Imap1.Mailboxes("INBOX").Copy "OldMail" ' Copy just the first and last message from INBOX to TestMbx MsgSet = "1," & Imap1.Mailboxes("INBOX").Count() Imap1.Mailboxes("INBOX").Copy "TestMbx", MsgSet Exit Sub OnError: ' Any error jumps here Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub