Private Sub Command1_Click() On Error GoTo OnError ' use intrinsic error handling ' Rename the "Misc" mailbox to "Test" Imap1.Mailboxes.Item("Misc").Name = "Test" Exit Sub OnError: ' Any error jumps here Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description End Sub