How to know the folder name

  • Thread starter Thread starter Ashish
  • Start date Start date
A

Ashish

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.
 
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.
 
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
 
OutlookInterop.NameSpace olNameSpace = null;
OutlookInterop.MAPIFolder oCalendar = null;
olNameSpace =
ThisAddIn.ApplicationObject.GetNamespace("mapi");
oCalendar =
olNameSpace.GetDefaultFolder(OutlookInterop.OlDefaultFolders.olFolderCalendar);
OutlookInterop.MAPIFolder folder =
ThisAddIn.ApplicationObject.ActiveExplorer().CurrentFolder;
oCalendar.name will do ?
 
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.
 
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.
 
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.
 
Back
Top