CDO and Extended MAPI are not supported for use with .NET code or for usage
across the Interop.
You can log into a different Outlook profile that has the secondary mailbox
or you can load it as part of your profile or use
NameSpace.GetSharedDefaultFolder to get at that mailbox. If it's part of
your profile just iterate the Folders collection of NameSpace to find the
top of that store and walk it down to get to the secondary mailbox. Using
GetSharedDefaultFolder you create a Recipient object of an alias that has
permissions to log into that mailbox and specify to load the Inbox folder.
From those points you just save the items as MSG as usual.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> C#.Net Outlook 2003 automation (programmatically) with
> Microsoft.Office.Interop.Outlook
[quoted text clipped - 32 lines]
> Thanks
> Rob
Ken,
Thanks for the suggestion.
Do you have a sample to create a recipient object that
uses GetSharedDefaultFolder in c#?
I have two mailboxes set in outlook
1) Mailbox - username1 -- default mailbox
2) Mailbox - username2
I should create a recipient object that points to Mailbox - username2
and lets assume an userid username2 and password of 'password'.
I should point to Mailbox - username2 and loop through the folders
collection to get to inbox and save the email messages to a *.msg file.
Thanks
Rob
> C#.Net Outlook 2003 automation (programmatically) with
> Microsoft.Office.Interop.Outlook
[quoted text clipped - 29 lines]
> Thanks
> Rob
Ken Slovak - [MVP - Outlook] - 13 Feb 2007 21:36 GMT
If the email address for mailbox 2 is "user2@mydomain.com" then it would go
something like this in C#.
// app == Outlook.Application, ns == NameSpace
Outlook.Recipient recip =
(Outlook.Recipient)ns.CreateRecipient("user2@mydomain.com");
recip.Resolve;
Outlook.MAPIFolder folder = (Outlook.Folder)ns.GetSharedDefaultFolder(recip,
Outlook.OlDefaultFolders.olFolderInbox);
or you can get the ns.Folders collection and look for one with a caption of
"Mailbox - User 2" and from there get that Folder's Folders collection and
look for one named "Inbox".

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Ken,
>
[quoted text clipped - 15 lines]
> Thanks
> Rob