redemption - foldercreate event + delegate user

W

wlan

hi,

I have a question regarding FOLDERCREATE event of mail store. I need to
listen this event for both primary mailbox & delegate mailbox.

So I have enumerated mail stores and subscribed FOLDERCREATE for the above
stores. But when a new folder is created in delegate user mailbox (outlook
folder tree view), it's not triggering FOLDER CREATE event handler.

This works perfect for primary mailbox. I don't know the reason why it's not
triggering for delegate mailbox.

Do I need to set any permissions?

Thanks
 
W

wlan

I have two exchange users - TestUserA & TestUserB. In outlook addin, i'm
enumerating stores using redemption technique.

When I enumerate stores and if storekind is PrimaryMailBox or
DelegateMailBox, I will get that mailbox store and subscribe foldercreate
event.

Now foldercreate is subscribed for primary mailbox & delegate mailbox.
TestUserA is logged on with delegate user feature enabled for TestUserB. i.e
TestUserA has subscribed FOLDER CREATE for Primary & delegate mailbox.

TestUserA can access TestUserB mailbox also. WHen TestUserA creates a new
folder under TestUserB\INBOX folder. FOLDER CREATE event is not get triggered
in TestUserA logged on session.

If TestUserB has logged on another machine, then that session will get
FOLDER CRETAE notification.,

I don't know why this is not triggered for TestUserA (with delagate
user-TestUserB) user.
 
K

Ken Slovak - [MVP - Outlook]

How are you opening that delegate mailbox? Is it being opened as part of the
Outlook profile for that test user?
 
W

wlan

Hi ken,

My profile is configured with both testusera & testuserB mailbox. I have
subscribed folder create event in OnCOnnection of addin.
 
K

Ken Slovak - [MVP - Outlook]

Please show the code you're using to establish that event handler, maybe it
will provide some clues.
 
W

wlan

Hi,

The following code is used for subscribing events of normal and delegate user.

Redemption.RDOSession rdoSession = new RDOSession();
if (rdoSession != null)
{
rdoSession.MAPIOBJECT =
this.applicationObject.Session.MAPIOBJECT;

//get stores
Redemption.RDOStores oRDOStores = rdoSession.Stores;

foreach (Redemption.RDOStore store in oRDOStores)
{
if (store.StoreKind ==
TxStoreKind.skPrimaryExchangeMailbox)
{
this.exchPrimaryMailStore =
(Redemption.RDOExchangeMailboxStore)store;
exchPrimaryStoreID = store.EntryID;
//break;
}
else if (store.StoreKind ==
TxStoreKind.skDelegateExchangeMailbox)
{
this.exchDelegateMailStore =
(Redemption.RDOExchangeMailboxStore)store;
exchDelegateStoreID = store.EntryID;
//break;
}
}


if (this.exchPrimaryMailStore != null)
{
this.exchPrimaryMailStore.OnFolderCreated += new
IRDOStoreEvents_OnFolderCreatedEventHandler(exchPrimaryMailStore_OnFolderCreated);
}


if (this.exchDelegateMailStore != null)
{
this.exchDelegateMailStore.OnFolderCreated += new
IRDOStoreEvents_OnFolderCreatedEventHandler(exchDelegateMailStore_OnFolderCreated);

}
 
K

Ken Slovak - [MVP - Outlook]

Offhand I'd suggest 2 things.

First, get the actual NameSpace object and use that to provide the
MAPIOBJECT to the RDOSession object instead of using Application.Session.

Second, see if touching the delegate store before adding the event handler
helps. Just get the Inbox and the Items collection of Inbox before adding
the OnFolderCreated() event handler.
 
W

wlan

Hi Ken,

I have tried both and its not firing this event for delegate user mailbox.
Current user has EDITOR permission in delegate user inbox. But still it's not
firing.

I can enumerate and see inbox folder items of delegate user mailbox. Also
I'm passing NAMESPACE.MAPIOBJECT now.

Do I need to set any other settings in exchange environment?

Or

Is there anything wrong in the code?
 
K

Ken Slovak - [MVP - Outlook]

Looks like you're using cached mode?

In testing here I found the OnFolderCreated() handler working for the
primary mailbox but not for delegate mailboxes when in cached mode. In
online to Exchange mode I did get the OnFolderCreated() handlers firing for
both primary and delegate mailboxes.

I assigned owner rights to the delegate mailbox, so permissions weren't an
issue.

I pinged Dmitry to see if this is unexpected or expected behavior.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top