How to know the folder name

Status
Not open for further replies.
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.
 
K

Ken Slovak - [MVP - Outlook]

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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:uMiUeUPbKHA.544@TK2MSFTNGP05.phx.gbl...
> 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.
>
 
A

Ashish

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

Aditi

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 ?

"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

> .
>
 
K

Ken Slovak - [MVP - Outlook]

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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:OvIUpEabKHA.1596@TK2MSFTNGP06.phx.gbl...
> > 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
>
 
A

Ashish

> 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.
<kenslovak@mvps.org> wrote in message

news:O3R%23UydbKHA.5976@TK2MSFTNGP05.phx.gbl...
> 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.

> >

>

> "Ashish" <akohli_2004@hotmail.com> wrote in message
> news:OvIUpEabKHA.1596@TK2MSFTNGP06.phx.gbl...
> >> 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
> >

>
 
K

Ken Slovak - [MVP - Outlook]

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.

"Ashish" <akohli_2004@hotmail.com> wrote in message

news:OolTnSBcKHA.2188@TK2MSFTNGP04.phx.gbl...
> > 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.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
G VBA to save selected Outlook msg with new name in selected network Windows folder Outlook VBA and Custom Forms 1
D Is a sub folder under contacts necessary to be able to name an Address Book? Using Outlook 1
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
R Search/Jump to a folder by typing its name Outlook VBA and Custom Forms 1
A saving attachement to folder named the same as rule name Outlook VBA and Custom Forms 0
C Changing the name of Outlook Messages saved to a folder Using Outlook 1
M Is there any easy way to quickly search for the name of a folder in Outlook's inbox folder structure Exchange Server Administration 1
O Saving Attachments to folder on disk and adding Initials to end of file name Outlook VBA and Custom Forms 9
M Finding a folder by name Outlook 2013 Using Outlook 4
T Messages no longer move to quote folder on shared mailbox after user adds -D to folder name Outlook VBA and Custom Forms 1
S Macro to create a new folder with subject line as the folder name Using Outlook 2
T Outlook add-in: How to find localized name of the "Junk e-mail"folder Outlook VBA and Custom Forms 15
Christopher M Outlook 365 Hey Diane! MS 365 Biz Standard and "Potential Spam" addressed to others coming to my JUNK folder? Using Outlook 2
J Quick steps delete original email and move reply/sent email to folder Using Outlook 2
A manual rule sends mail to wrong folder Using Outlook 5
richardwing Auto forward email that is moves into a specific outlook folder Outlook VBA and Custom Forms 5
D This folder up to date vs all folders up to date Using Outlook 1
G Automatically delete messages in the synchronization folder Outlook VBA and Custom Forms 1
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 3
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10
P Emails assigned with a certain category (within a shared inbox) to be copied to a specific folder. Outlook VBA and Custom Forms 2
M Saving emails using Visual Basic - Selecting folder with msoFileDialogFolderPicker Outlook VBA and Custom Forms 6
S Folder Pane Colour Categories Using Outlook 6
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
NVDon Create new Move To Folder list Outlook VBA and Custom Forms 0
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
O Cannot expand the folder. The set of folders cannot be opened. You do not have permission to log on. Using Outlook 1
F Jump to Inbox folder when click on Favorite Using Outlook 8
P Print attachments automatically and move the mail to an existing folder called "Ted" Outlook VBA and Custom Forms 4
lcarpay Stay in the mail folder pane after ctrl-1 Using Outlook 1
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
F VBA to move email from Non Default folder to Sub folders as per details given in excel file Outlook VBA and Custom Forms 11
bhamberg Shortcuts in Folder Pane (Outlook 2016) Using Outlook 19
P Posts in Folder No Longer Group by Conversation Column After Search Using Outlook 0
Y Filter unread emails in a search folder vba help Outlook VBA and Custom Forms 0
N contact list seen in Contact folder but knot in Address book or when 'TO' button is clicked in new email Using Outlook 0
D How to remove a folder, option grayed out Using Outlook 4
D How To Combine Share Task Folders in just one Folder Using Outlook 0
G Retention Policy for Outlook.com Deleted Items folder Using Outlook 0
Z Outlook 365 delete reminder you can’t make change to contents of this-read only folder Using Outlook 4
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 1
O The Outlook API wrongfully shows an outlook folder to have zero sub-folders Outlook VBA and Custom Forms 2
S Outlook (2016 32bit; Gmail IMAP) - Save sent message to Outllook Folder Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
C VBA to prompt for Sent folder destination Outlook VBA and Custom Forms 3
G How to add a folder shortcut to outlook quick access toolbar? Using Outlook 6
G Add to Outlook Contacts - Point to non-default contacts folder Using Outlook 0
M Move to Folder Using Outlook 1
K Export Folder to PST Outlook VBA and Custom Forms 2

Similar threads

Top