views:

137

answers:

2

Is it possible to get list of all existing accounts from Outlook 2003 using only standard COM? It means I can't use Redemption library, but only default Outlook 2003 object model . It's much easy to get accounts at Outlook 2007/2010:

dynamic outlook = AutomationFactory.GetObject("Outlook.Application");
var accounts = outlook.Session.Accounts;

But there is no "Accounts" property for Outlook 2003. By default I can access only default account using "CurrentUser" property. So maybe is there some another way to obtain all accounts (using ONLY Outlook 2003 object model)?

+1  A: 

The Accounts property is not available in the Outlook 2003 object model. One way to get this information is to use Extended MAPI (MAPI 1.0), and the EnumerateAccounts method of the IOlkAccountManager interface. However, using Extendend MAPI from manage code is discouraged. There are third party wrappers available, a pouplar one being Redemption. Below are a few resources that will be helpful.

http://support.microsoft.com/kb/200018

http://www.codeproject.com/KB/IP/CMapiEx.aspx

http://www.codeproject.com/KB/office/BridgingTheGap.aspx

Garett
I need accounts, not contacts. They're different things.
zenonych
I misread your question. I've modified my answer accordingly.
Garett
Thanks for your answer, but as I wrote before, I can't use Redemption library or other third party libs. But I've already found answer. So thanks for your help.
zenonych
+1  A: 

I've finally found answer. I'm not using object model, but I do exactly same as Redemption (read registry). So it's acceptable answer as for me.

zenonych