I configured two Exchange accounts in Outlook 2010, however I cant find out how to get to Inbox of the second account. Session.GetDefaultFolder()
always return the first one.
Even enumerating Session.Accounts, finding the right account and calling Session.Account(found one).Store.GetDefaultFolder()
returns wrong Inbox (from the default exchange account, not the secondary).
Does this show you all the available Inboxes?
Sub LoopThroughInboxes
Dim ol As Outlook.Application
Dim ns As Outlook.NameSpace
Dim i As Long
Set ol = Outlook.Application
Set ns = ol.GetNamespace("MAPI")
For i = 1 To ns.Folders.Count
Debug.Print ns.Folders(i).Name
Next i
If so then ns.Folders(i).Folders("Inbox")
will get you the Inbox for each mailbox.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With