Discussion:
Root Folders for multiple mail boxes
(too old to reply)
xjohnom
2010-04-21 22:21:05 UTC
Permalink
Hello All,

I have been horsing around with this for a couple of days and I know the
solution is probably going to be embarrasingly obvious but here goes anyway,

My Outlook sign on has permission on a number of shared mailboxes. These
mailboxes are not configured in my Outlook application but their names are
stored in a database which I have access to.

I need to be able to get a collection of folders together that has all of the
Root folders for these mailboxes. I can then iterate through them and do the
gratifying functional stuff.

This is as far as I have got:

_Recipient = _Namespace.CreateRecipient("XXXXXXX");
_folder = _app.GetNamespace("MAPI").GetSharedDefaultFolder
(_Recipient, Outlook.OlDefaultFolders.olFolderInbox);

However the folders I am after are at the same level as the inbox so while it
was encouraging to be able to see the inbox I still need to be able to move
up the hierarchy. I have been trying to use the .parent property of the
_folder object but no luck there even when I cast it to an Outlook.
MAPIFolder type.

Anybody put me out of my misery?

BTW some of the gratifying stuff involves creating objects in these folder
programmatically.

John O'
Dmitry Streblechenko
2010-04-22 05:52:49 UTC
Permalink
I don't think you can do that in Outlook unless you add the mailboxes in
question first as delegate mailboxes.
<plug>
You can use Redemption (url below) for that - see
RDOSession.GetSharedMailbox (use RDOStore.IPMRootFolder) and
RDOSession.Stores.AddDelegateExchangeMailBoxStore
</plug>
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Post by xjohnom
Hello All,
I have been horsing around with this for a couple of days and I know the
solution is probably going to be embarrasingly obvious but here goes anyway,
My Outlook sign on has permission on a number of shared mailboxes. These
mailboxes are not configured in my Outlook application but their names are
stored in a database which I have access to.
I need to be able to get a collection of folders together that has all of the
Root folders for these mailboxes. I can then iterate through them and do the
gratifying functional stuff.
_Recipient = _Namespace.CreateRecipient("XXXXXXX");
_folder = _app.GetNamespace("MAPI").GetSharedDefaultFolder
(_Recipient, Outlook.OlDefaultFolders.olFolderInbox);
However the folders I am after are at the same level as the inbox so while it
was encouraging to be able to see the inbox I still need to be able to move
up the hierarchy. I have been trying to use the .parent property of the
_folder object but no luck there even when I cast it to an Outlook.
MAPIFolder type.
Anybody put me out of my misery?
BTW some of the gratifying stuff involves creating objects in these folder
programmatically.
John O'
Continue reading on narkive:
Loading...