How to add additional exchange mailboxes to outlook through code

GJCook used Ask the Experts™
How can I add an additional exchange mailbox (NOT a pst folder) to the outlook folder list through code?  If you are interested, my reasons for wanting to so this are set out below:

I am developing a Com add in to help my company deal with project emails.  Until now project email has always gone to an individual’s mailbox.  This makes project management difficult as the project mail gets split across several mailboxes and users have not got permission to view team members’ mailboxes (contentious issue!).

So what we have done is adopted project email accounts and devised a system whereby all email relating to a particular project get routed to the correct project account (based on simple criteria the user controls).  All project members have the relevant project mailboxes added to their outlook profile (manually throught tools - services).

But very few of our users understand how to add a project mailbox to their outlook folder list and as a result the com add in needs support from the IT department (continuously adding and removing project mailboxes as team members change!).
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I sure hope you are developing in C/C++ (or Delphi) and Extended MAPI because you need to use some complex interfaces that are not supported via VB/VBA.  In any case, here is a code sample.;en-us;q171636


Always nice when these things work first time!  Thank you very much.
Don't suppose you know where I can find a remove mailbox function do you?

I couldn't find an exact example, but maybe one these two samples will help you with IProfAdmin's DeleteProvider call.;en-us;172556;en-us;228736

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial