Redemption: FolderCreate event on exchange store

  • Thread starter Thread starter WLAN
  • Start date Start date
W

WLAN

Hi,

I have a use case where i need to inject some custom action on folder create
event of Outlook. So initially i tried to use FolderAdd event of Outlook
Object model. But i faced lot of issues regarding subscribing this event in
2003 & 2007.

So i switched this event handling to exchange store level using Redemption
technique. This works fine in all use cases.

But my custom action gets executed sometimes when I click Unread Mail folder
or For Follow up , Large Mail, Tracked mail processing etc folders.

I think outlook creates some folder when I click on the above folders. This
seems to occuring only once when a fresh outlook installation is done,

Any idea, how do i solve this issue?
 
Those are search folders being created at that point.

What you can do is to use RDOSession.Stores.DefaultStore.SearchFolderRoot to
get at the RDOFolder object that is the root of the search folders. From
there you can iterate the RDOFolder.Folders collection which should hold all
those search folders. Get each search folder as an RDOFolder and get the
EntryID property. Use RDOSession.CompareEntryIDs to compare each of those
EntryID values with the value passed to you in the OnFolderCreated event
handler. If any come back as matches you know the newly created folder is a
search folder and you can then choose to ignore it.
 
If you need to ignore a search folder, open the fodler using
RDOSession.GetFolderFormID, then check whether this a search folder - check
if it is IRDOSearchFolder object.
Or read the PR_FOLDER_TYPE property (0x36010003) using RDOFolder.Fields[]
and see if it is FOLDER_SEARCH (2).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
Thanks Dmitry, Ken.

Now i'm checking folder type and issue is solved.


Dmitry Streblechenko said:
If you need to ignore a search folder, open the fodler using
RDOSession.GetFolderFormID, then check whether this a search folder - check
if it is IRDOSearchFolder object.
Or read the PR_FOLDER_TYPE property (0x36010003) using RDOFolder.Fields[]
and see if it is FOLDER_SEARCH (2).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
WLAN said:
Hi,

I have a use case where i need to inject some custom action on folder
create
event of Outlook. So initially i tried to use FolderAdd event of Outlook
Object model. But i faced lot of issues regarding subscribing this event
in
2003 & 2007.

So i switched this event handling to exchange store level using Redemption
technique. This works fine in all use cases.

But my custom action gets executed sometimes when I click Unread Mail
folder
or For Follow up , Large Mail, Tracked mail processing etc folders.

I think outlook creates some folder when I click on the above folders.
This
seems to occuring only once when a fresh outlook installation is done,

Any idea, how do i solve this issue?
 
Hello,

I have another query regarding FOLDERCREATE event. I have an outlook user
'testuser1' which subscribes FOLDERCREATE event of mailbox store.

Now the same user is logon multiple times in different machines. Now when he
creates a new folder under inbox or somewhere inside the mailbox, i want to
restrict FOLDERCREATE event handling to that machine.

How do I solve this use case?

Thanks



Dmitry Streblechenko said:
If you need to ignore a search folder, open the fodler using
RDOSession.GetFolderFormID, then check whether this a search folder - check
if it is IRDOSearchFolder object.
Or read the PR_FOLDER_TYPE property (0x36010003) using RDOFolder.Fields[]
and see if it is FOLDER_SEARCH (2).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
WLAN said:
Hi,

I have a use case where i need to inject some custom action on folder
create
event of Outlook. So initially i tried to use FolderAdd event of Outlook
Object model. But i faced lot of issues regarding subscribing this event
in
2003 & 2007.

So i switched this event handling to exchange store level using Redemption
technique. This works fine in all use cases.

But my custom action gets executed sometimes when I click Unread Mail
folder
or For Follow up , Large Mail, Tracked mail processing etc folders.

I think outlook creates some folder when I click on the above folders.
This
seems to occuring only once when a fresh outlook installation is done,

Any idea, how do i solve this issue?
 
Can't do that, the event will fire in all sessions connected to that
mailbox.
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
WLAN said:
Hello,

I have another query regarding FOLDERCREATE event. I have an outlook user
'testuser1' which subscribes FOLDERCREATE event of mailbox store.

Now the same user is logon multiple times in different machines. Now when
he
creates a new folder under inbox or somewhere inside the mailbox, i want
to
restrict FOLDERCREATE event handling to that machine.

How do I solve this use case?

Thanks



Dmitry Streblechenko said:
If you need to ignore a search folder, open the fodler using
RDOSession.GetFolderFormID, then check whether this a search folder -
check
if it is IRDOSearchFolder object.
Or read the PR_FOLDER_TYPE property (0x36010003) using RDOFolder.Fields[]
and see if it is FOLDER_SEARCH (2).

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
WLAN said:
Hi,

I have a use case where i need to inject some custom action on folder
create
event of Outlook. So initially i tried to use FolderAdd event of
Outlook
Object model. But i faced lot of issues regarding subscribing this
event
in
2003 & 2007.

So i switched this event handling to exchange store level using
Redemption
technique. This works fine in all use cases.

But my custom action gets executed sometimes when I click Unread Mail
folder
or For Follow up , Large Mail, Tracked mail processing etc folders.

I think outlook creates some folder when I click on the above folders.
This
seems to occuring only once when a fresh outlook installation is done,

Any idea, how do i solve this issue?
 
Back
Top