I'm trying to get the inbox of a specific email address where there is more than one address connected to the same Outlook.
I can only succeed if I check the main mailbox (the first listed in Outlook).
dim outlApp as Object
dim outlNsp as Object
dim outlMapp as Object
dim outlsubMapp as Object
dim Mappar as Object
outlApp = CreateObject("Outlook.Application")
outlNsp = outlApp.GetNamespace("MAPI")
outlMapp = outlNsp.Folders.item(Mail_username)
Mappar = outlMapp.Folders
outlsubMapp = Mappar.item(6)
'6 is olFolderInbox enum value
outlsubMapp = outlNsp.GetDefaultFolder(6)
'6 is olFolderInbox enum value
Inbox = outlsubMapp.Name
If I change Mail_username I still get the first email inbox folder.