How can I iterate through accounts/mailboxes in Outlook using VB .NET?
Posted on 2010-09-10
I have a small application which monitors unread mail in a user's Outlook application. Some users have one single account and some people have several (I don't always know how many).
My problem is how to iterate through the accounts/mailboxes and if I can, will the "NewMail" event be fired for all mailboxes?
I've tried e.g. "For each oAccount in oAccounts" but keep getting a "This is read-only memory" error for some reason. Do I have to loop through Namespace recipients and resolve them all instead?
I'm using Outlook 2003 and Visual Studio 2008