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
V Folder Properties - Gmail account can't switch Using Outlook 5
Victor_50 Outlook 2019 Jump to folder from search folder Outlook VBA and Custom Forms 0
HarvMan Outlook 365 - Rule to Move an Incoming Message to Another Folder Using Outlook 4
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
I Help with Smart Folder + Query Builder on IMAP Using Outlook 0
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
Kika Melo Outlook Calendar deleted appointments not in Deleted Items folder Using Outlook 3
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0
Z Outlook 365 Automatically assign categories to incoming mail in a shared folder Round Robin Outlook VBA and Custom Forms 1
G Adding a contact to a specific folder Using Outlook 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 7
Rupert Dragwater Duplicate email in Folder Using Outlook 7
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
L "Insert Pictures" Button-Wrong Folder Using Outlook 5
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
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 4
wayneame Changing the Form Used by Existing Task Items in a Folder Outlook VBA and Custom Forms 4
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

Similar threads

Top