Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: FolderAdd event and folder creation

Geek News

FolderAdd event and folder creation
SeekerOfTruths[ at ]hotmail.co.uk 9/14/2006 3:22:47 PM
Hi, I am currently trying to detect when a user is attempting to create
a new folder in Outlook so that I can present an alternative to the New
Folder dialog when the user is performing this action in a particular
(non-Exchange) message store.

I can intercept the EECMDID_FileNewFolder command via the
IExchExtCommands interface and this allows me to catch folder creation
when the user selects File->New->Folder from the Outlook Menu, however
it doesn't work when New Folder is selected from the right-click
context menu in the hierarchy pane.

I've found that the Outlook Object Model has a FolderAdd event, which I
might be able to make use of in this situation, but I have a suspicion
that this event fires AFTER the call to CreateFolder on the parent
IMAPIFolder object (which is after the New Folder dialog has been
presented and the user has clicked on the OK button to create the new
folder).

Can anyone tell me whether or not my suspicion is correct, and if it is
correct, whether there is any other way in which I might be able to
intercept the New Folder dialog and replace it with my own (when
working with folder objects in my message store)?

Regards,

Seeker.

Re: FolderAdd event and folder creation
"asidden[ at ]gmail.com" <asidden[ at ]gmail.com> 9/15/2006 7:30:27 AM
Yep, you're right.

FolderAdd events fires after folder creation. It's signature has an
pointer to the folder object, which was just created.

SeekerOfTruths[ at ]hotmail.co.uk wrote:
[Quoted Text]
> Hi, I am currently trying to detect when a user is attempting to create
> a new folder in Outlook so that I can present an alternative to the New
> Folder dialog when the user is performing this action in a particular
> (non-Exchange) message store.
>
> I can intercept the EECMDID_FileNewFolder command via the
> IExchExtCommands interface and this allows me to catch folder creation
> when the user selects File->New->Folder from the Outlook Menu, however
> it doesn't work when New Folder is selected from the right-click
> context menu in the hierarchy pane.
>
> I've found that the Outlook Object Model has a FolderAdd event, which I
> might be able to make use of in this situation, but I have a suspicion
> that this event fires AFTER the call to CreateFolder on the parent
> IMAPIFolder object (which is after the New Folder dialog has been
> presented and the user has clicked on the OK button to create the new
> folder).
>
> Can anyone tell me whether or not my suspicion is correct, and if it is
> correct, whether there is any other way in which I might be able to
> intercept the New Folder dialog and replace it with my own (when
> working with folder objects in my message store)?
>
> Regards,
>
> Seeker.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net