Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Dim objOutlook As Object 'Outlook.Application Dim OutlookNameSpace As Object dim MailboxFolderNumber as Integer On Error GoTo Err_ImportEmails_Click Set objOutlook = GetObject(, "Outlook.application") Set OutlookNameSpace = objOutlook.GetNamespace("MAPI") MailboxFolderNumber = 3 FindMailboxFolder: Set Inbox = OutlookNameSpace.Folders(MailboxFolderNumber).Folders("Inbox").Folders("New Entries") . . . Exit_ImportEmails_Click: Set objOutlook = Nothing Set OutlookNameSpace = Nothing Exit Sub Err_ImportEmails_Click: If Err.Number = -2147221233 Then MailboxFolderNumber = MailboxFolderNumber + 1 GoTo FindMailboxFolder Else MsgBox Err.Number & vbCrLf & Err.Description, , "ImportEmails_Click" End If Resume Exit_ImportEmails_Click
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.