Only Outlook 2010 allows you to set/clear/add to Selection.
You are also assuming that if a context menu is displayed that it's for
whatever is selected, a logical fallacy. I would get the same response but
with a different context menu displayed if I right-clicked on a non-selected
item, a folder in the Navigation Pane, etc.
I could right-click on the second item in the view but have the first item
selected. You just can't tell.
Only starting with Outlook 2007 do you get to properly handle context menus
and know which is being displayed and what was 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
"TTT" <alistair[at]timetracer[dot]com[dot]au> wrote in message
news:%(E-Mail Removed)...
> My add-in is causing a minor problem with large files in Inbox.
>
> I have Download Only Headers For Items Larger Than set to 10k. Any larger
> emails will display only their headers until I Mark To Download and
> Process All Marked Headers. This should cause the entire body to display,
> but with the add-in enabled they will not. I have to click onto another
> email then back, sometimes repeatedly.
>
> The code that causes the problem is the same as in my previous Post
> Add-in problem: First email in outbox gets stuck
>
>
> It's where we are trying to add items to the context menu if the user has
> right clicked on an email.
> if (_explorer.Selection[1] is Outlook.MailItem)
> Touching the email seems to cause this problem, but I can't think of how
> to avoid this since these are the emails we want to change the menu for.
>
> Is there no way to reset the Selection to its previous state?. Submitted
> using http://www.outlookforums.com