Finding out if a folder or message has focus

  • Thread starter Thread starter Chris Day
  • Start date Start date
C

Chris Day

I am writing an Outlook Add-In in C# that exports emails from Outlook.
Because you can't alter the context menus I have a menu item that I
have added under the File menu.

Currently I can export emails fine, but what I would like to be able
to do is find out if some one has just clicked on a folder and then
clicked on my menu item so I can export all emails in that folder and
all the emails in it's sub-folders. Currently all I can do is get the
active explorer then look at the Selection property which only holds
the MailItem's from the selected folder.

Is there a way to find out which pane had focus before the menu item
was clicked?

Chris
 
Why does it matter whether a message or a folder was selected? 99.9% of the
time I do not remember whether a message or a folder was selected. Why not
have two separate menu items - one acts on the active folder and another one
on the selected messages.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top