A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Subscribing New folder event



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 10th 09, 05:23 PM posted to microsoft.public.outlook.program_forms
WLAN
external usenet poster
 
Posts: 49
Default Subscribing New folder event


Hello,

I have a requirement where i need to hook / subscribe new folder add event.
When user creates a new folder by clicking and say 'New folder', i want to do
some custom actions.

How do I implement this problem? Basically i need to handle folderadd event.
Which folder object i need to subscribe???


Ads
  #2  
Old January 10th 09, 06:24 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Subscribing New folder event

NameSpace.Folders.FolderAdd

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
...

Hello,

I have a requirement where i need to hook / subscribe new folder add
event.
When user creates a new folder by clicking and say 'New folder', i want to
do
some custom actions.

How do I implement this problem? Basically i need to handle folderadd
event.
Which folder object i need to subscribe???



  #3  
Old January 11th 09, 01:24 AM posted to microsoft.public.outlook.program_forms
WLAN
external usenet poster
 
Posts: 49
Default Subscribing New folder event

I want to handle folder add event in the following cases:

User can create folder under any root folder, sub folder or sub sub folders.
So if subscribe namespace.folders.folderadd, Will it trigger for sub folder
or sub sub folder of that collection.

How do I handle this situation?

I need to handle folderadd event when user says 'New Folder'. The new folder
can be under root folder or can be under Inbox or can under Drafts or can be
under Inbox\MyMails.




"Ken Slovak - [MVP - Outlook]" wrote:

NameSpace.Folders.FolderAdd

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
...

Hello,

I have a requirement where i need to hook / subscribe new folder add
event.
When user creates a new folder by clicking and say 'New folder', i want to
do
some custom actions.

How do I implement this problem? Basically i need to handle folderadd
event.
Which folder object i need to subscribe???




  #4  
Old January 12th 09, 02:50 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Subscribing New folder event

NameSpace.Folders will be a collection of all the stores you have open (PST
files, Exchange maiboxes and Exchange public folders). Add a new store and
NameSpace.Folders.FolderAdd will fire.

Assuming you have only 1 store open, say a PST file, then to get a new
folder added at the top level just under Personal Folders you'd use this:

NameSpace.Folders.Item(1).Folders.FolderAdd

That would only handle adding a top level folder.

To get a new folder added under Inbox (as an example) you have to get Inbox
and its Folders collection and subscribe to FolderAdd for that collection.
Another handler would have to handle FolderAdd for subfolders of Calendar,
etc.

FolderAdd will only fire for that specific Folders collection, not any
Folders collection anywhere. So to do exactly what you want you'd need to
instantiate an object for every existing folder in the store and handle the
FolderAdd event for every one of those folder's Folders collection. It can't
be handled with just one universal event handler.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
news
I want to handle folder add event in the following cases:

User can create folder under any root folder, sub folder or sub sub
folders.
So if subscribe namespace.folders.folderadd, Will it trigger for sub
folder
or sub sub folder of that collection.

How do I handle this situation?

I need to handle folderadd event when user says 'New Folder'. The new
folder
can be under root folder or can be under Inbox or can under Drafts or can
be
under Inbox\MyMails.


  #5  
Old January 21st 09, 04:04 PM posted to microsoft.public.outlook.program_forms
WLAN
external usenet poster
 
Posts: 49
Default Subscribing New folder event

Hi Ken,

Thanks for the reply.

But which event do i need to handle for subscribing folderadd event? now I'm
subscribing folders.folderadd in the below events:


this.m_activeExplorer =
(Outlook11.Explorer)this.applicationObject.ActiveE xplorer();
if (this.m_activeExplorer != null)//subscribe folder switch
event handler
{
this.m_currentFolderCollection =
(Outlook11.Folders)this.m_activeExplorer.CurrentFo lder.Folders;
if (this.m_currentFolderCollection != null)
{
this.m_currentFolderCollection.FolderAdd +=new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);
}

//folder switch
this.m_activeExplorer.FolderSwitch += new
Outlook11.ExplorerEvents_10_FolderSwitchEventHandl er(exp_FolderSwitch);
}

private void exp_FolderSwitch()
{
//get current active explorer
if (this.m_activeExplorer != null)
{
//if any previously selected folder exists
if(this.m_currentFolderCollection != null)
this.m_currentFolderCollection.FolderAdd -= new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);

this.m_currentFolderCollection =
(Outlook11.Folders)this.m_activeExplorer.CurrentFo lder.Folders;
if (this.m_currentFolderCollection != null)
{
this.m_currentFolderCollection.FolderAdd += new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);
}

But I'm facing issues in Outlook 2007. In outlook 2007, user can right click
without selecting a node in tree view. So I will not get the correct folder.

Also the new folder can be changed using PickFolder dialog displayed while
specifying a new folder name.

Which event handler do I need to use for subscribing Folders.FolderAdd event?

Thanks
"Ken Slovak - [MVP - Outlook]" wrote:

NameSpace.Folders will be a collection of all the stores you have open (PST
files, Exchange maiboxes and Exchange public folders). Add a new store and
NameSpace.Folders.FolderAdd will fire.

Assuming you have only 1 store open, say a PST file, then to get a new
folder added at the top level just under Personal Folders you'd use this:

NameSpace.Folders.Item(1).Folders.FolderAdd

That would only handle adding a top level folder.

To get a new folder added under Inbox (as an example) you have to get Inbox
and its Folders collection and subscribe to FolderAdd for that collection.
Another handler would have to handle FolderAdd for subfolders of Calendar,
etc.

FolderAdd will only fire for that specific Folders collection, not any
Folders collection anywhere. So to do exactly what you want you'd need to
instantiate an object for every existing folder in the store and handle the
FolderAdd event for every one of those folder's Folders collection. It can't
be handled with just one universal event handler.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
news
I want to handle folder add event in the following cases:

User can create folder under any root folder, sub folder or sub sub
folders.
So if subscribe namespace.folders.folderadd, Will it trigger for sub
folder
or sub sub folder of that collection.

How do I handle this situation?

I need to handle folderadd event when user says 'New Folder'. The new
folder
can be under root folder or can be under Inbox or can under Drafts or can
be
under Inbox\MyMails.



  #6  
Old January 21st 09, 04:14 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Subscribing New folder event

For Outlook 2007 you can subscribe to the context menu events that occur
when you right-click somewhere in Outlook. So you can use the
Application.FolderContextMenuDisplay() event or other context menu events.

Even that doesn't really cover all the possibilities though, and FolderAdd()
only applies to that specific Folders collection. So to really cover all the
bases you'd need to subscribe to that event for every existing folder in the
store to really know when and where a new folder was added anywhere in
Outlook.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
...
Hi Ken,

Thanks for the reply.

But which event do i need to handle for subscribing folderadd event? now
I'm
subscribing folders.folderadd in the below events:


this.m_activeExplorer =
(Outlook11.Explorer)this.applicationObject.ActiveE xplorer();
if (this.m_activeExplorer != null)//subscribe folder switch
event handler
{
this.m_currentFolderCollection =
(Outlook11.Folders)this.m_activeExplorer.CurrentFo lder.Folders;
if (this.m_currentFolderCollection != null)
{
this.m_currentFolderCollection.FolderAdd +=new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);
}

//folder switch
this.m_activeExplorer.FolderSwitch += new
Outlook11.ExplorerEvents_10_FolderSwitchEventHandl er(exp_FolderSwitch);
}

private void exp_FolderSwitch()
{
//get current active explorer
if (this.m_activeExplorer != null)
{
//if any previously selected folder exists
if(this.m_currentFolderCollection != null)
this.m_currentFolderCollection.FolderAdd -= new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);

this.m_currentFolderCollection =
(Outlook11.Folders)this.m_activeExplorer.CurrentFo lder.Folders;
if (this.m_currentFolderCollection != null)
{
this.m_currentFolderCollection.FolderAdd += new
Microsoft.Office.Interop.Outlook.FoldersEvents_Fol derAddEventHandler(m_currentFolderCollection_Folde rAdd);
}

But I'm facing issues in Outlook 2007. In outlook 2007, user can right
click
without selecting a node in tree view. So I will not get the correct
folder.

Also the new folder can be changed using PickFolder dialog displayed while
specifying a new folder name.

Which event handler do I need to use for subscribing Folders.FolderAdd
event?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem subscribing to Newsgroups Alan C. Brown Outlook Express 4 June 21st 08 05:19 AM
subscribing RICK Outlook - General Queries 2 July 13th 07 08:54 PM
Subscribing in topics Javad Outlook Express 6 November 28th 06 12:50 AM
Subscribing to an RSS Sue Mosher [MVP-Outlook] Outlook and VBA 0 November 25th 06 04:01 AM
Subscribing to an RSS Nas Outlook and VBA 1 November 25th 06 03:39 AM


All times are GMT +1. The time now is 12:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.