views:

53

answers:

1

I'm trying to find a way using the Office.Interop.Outlook COM object to connect to an additional Mailbox. Currently I am doing the following (after adding the COM object):

var app = new Microsoft.Office.Interop.Outlook.Application();
var ns = app.GetNamespace("MAPI");
ns.Logon();
var inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);

This successfully connects me to my main Inbox which I can then loop through.

What I am trying to find next is a way to use additional Mailbox X and get the default folder.

I am using Framework 4.0 with the COM object Microsoft Outlook 12.0 Object Library (version 9.3)

Not sure on the version of Exchange.

Cheers

A: 

I Think I have it:

ns = app.GetNamespace("MAPI");
ns.Logon();
var recipient = ns.CreateRecipient("[email protected]");
recipient.Resolve();
var sharedFolder = ns.GetSharedDefaultFolder(recipient, Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);

Not sure if the ns.Logon is necessary, but I have left it anyway.

Luke Duddridge