Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   How to know the folder name (http://www.outlookbanter.com/add-ins-outlook/97358-how-know-folder-name.html)

Ashish November 24th 09 10:57 AM

How to know the folder name
 
How to get the folder name in any folder context menu event.
Create a folder under Inbox say folder1. To delete folder1, Select folder
Inbox. Right click on folder1 and select Delete. It will fire delete event
for context menu. In this delete event i can get the button for Delete
action on toolbar. But i do not know for which folder Delete event was
called.
ActiveExplorer-GetCurrentFolder() returns folder Inbox because before
deleting folder1 i select folder Inbox.
Is there any way to know that delete event was called for folder1.



Ken Slovak - [MVP - Outlook] November 24th 09 02:54 PM

How to know the folder name
 
Version of Outlook?

If this is Outlook 2007 you can use the
Application.FolderContextMenuDisplay() event to get the folder and its name
from the second argument passed to that event handler.

There's nothing really helpful for earlier versions of 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


"Ashish" wrote in message
...
How to get the folder name in any folder context menu event.
Create a folder under Inbox say folder1. To delete folder1, Select folder
Inbox. Right click on folder1 and select Delete. It will fire delete event
for context menu. In this delete event i can get the button for Delete
action on toolbar. But i do not know for which folder Delete event was
called.
ActiveExplorer-GetCurrentFolder() returns folder Inbox because before
deleting folder1 i select folder Inbox.
Is there any way to know that delete event was called for folder1.



Ashish November 25th 09 07:28 AM

How to know the folder name
 
If this is Outlook 2007 you can use the
Application.FolderContextMenuDisplay() event to get the folder and its
name from the second argument passed to that event handler.


thanks

There's nothing really helpful for earlier versions of Outlook.


for outlook 2003 is there no way to track it



Aditi November 25th 09 01:52 PM

How to know the folder name
 
OutlookInterop.NameSpace olNameSpace = null;
OutlookInterop.MAPIFolder oCalendar = null;
olNameSpace =
ThisAddIn.ApplicationObject.GetNamespace("mapi");
oCalendar =
olNameSpace.GetDefaultFolder(OutlookInterop.OlDefa ultFolders.olFolderCalendar);
OutlookInterop.MAPIFolder folder =
ThisAddIn.ApplicationObject.ActiveExplorer().Curre ntFolder;
oCalendar.name will do ?

"Ashish" wrote:

If this is Outlook 2007 you can use the
Application.FolderContextMenuDisplay() event to get the folder and its
name from the second argument passed to that event handler.


thanks

There's nothing really helpful for earlier versions of Outlook.


for outlook 2003 is there no way to track it


.


Ken Slovak - [MVP - Outlook] November 25th 09 02:34 PM

How to know the folder name
 
No, not really. There are hacks that can be used such as handling deletions
and then checking a list you maintain of existing folders and seeing what's
missing, but the problem is that in Outlook 2003 and earlier you can
right-click on something that's not selected and you never get the context
of what was actually right-clicked.

--
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


"Ashish" wrote in message
...
If this is Outlook 2007 you can use the
Application.FolderContextMenuDisplay() event to get the folder and its
name from the second argument passed to that event handler.


thanks

There's nothing really helpful for earlier versions of Outlook.


for outlook 2003 is there no way to track it



Ashish November 28th 09 10:20 AM

How to know the folder name
 
No, not really. There are hacks that can be used such as handling
deletions and then checking a list you maintain of existing folders and
seeing what's missing, b


Do you mean If we maintain a list of folders, after deleting a folder we'll
remove it from list. I am confuse with this solution. The reason is

I found a problem in outlook 2003. If folder1 exist under Inbox and i delete
folder1 then it will go to Deleted Items. But when i check parent folder
name for folder1, outlook still shows it Inbox (not Deleted Items). Outlook
2003 takes 1-2 seconds to change folder name.
"Ken Slovak - [MVP - Outlook]" wrote in message
...
No, not really. There are hacks that can be used such as handling
deletions and then checking a list you maintain of existing folders and
seeing what's missing, but the problem is that in Outlook 2003 and earlier
you can right-click on something that's not selected and you never get the
context of what was actually right-clicked.

--
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


"Ashish" wrote in message
...
If this is Outlook 2007 you can use the
Application.FolderContextMenuDisplay() event to get the folder and its
name from the second argument passed to that event handler.


thanks

There's nothing really helpful for earlier versions of Outlook.


for outlook 2003 is there no way to track it





Ken Slovak - [MVP - Outlook] November 29th 09 06:57 PM

How to know the folder name
 
There's not much you can do about a lag like that, where the cached value is
invalid, if it's not due to unreleased objects. About all you can do is wait
it out.

--
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


"Ashish" wrote in message
...
No, not really. There are hacks that can be used such as handling
deletions and then checking a list you maintain of existing folders and
seeing what's missing, b


Do you mean If we maintain a list of folders, after deleting a folder
we'll remove it from list. I am confuse with this solution. The reason is

I found a problem in outlook 2003. If folder1 exist under Inbox and i
delete folder1 then it will go to Deleted Items. But when i check parent
folder name for folder1, outlook still shows it Inbox (not Deleted Items).
Outlook 2003 takes 1-2 seconds to change folder name.




All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com