How to Capture Events for an Item selected in the Explorer?

Add-in Express™ Support Service
That's what is more important than anything else

How to Capture Events for an Item selected in the Explorer?
Using "OutlookItemEvents" example and _ExplorerSelectionChange event 
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Hi Tri.

Right click on the addinmodule designer and choose the 'Add Keybord Shortcut' option.
Then you can use any keyboard combination in the ShortcutText property (e.g. Ctrl+A).
And don't forget to set the HandleShortcuts property of the addinmodule to true.
Posted 12 Jun, 2006 08:45:55 Top
Tri Nguyen




Posts: 7
Joined: 2006-05-25
Sounds straightforward enough, yet I cannot see an "Add Keyboard Shortcut" option in the addinmodule designer. Here's what I see when I right-click:

View Code
--
Paste
--
Line Up Icons
Show Large Icons
--
Add CommandBar
Add Explorer CommandBar
Add Inspector CommandBar
Add Built-In Control
Add Events
Host Configuration
About
--
Properties

Posted 12 Jun, 2006 10:54:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Tri, do you use ADX v2.5.1759 ?
Posted 12 Jun, 2006 15:42:44 Top
Tri Nguyen




Posts: 7
Joined: 2006-05-25
Ah, I'm using ADX.NET 2.4.1757.

OK, I'll install 2.5! Thanks.
Posted 13 Jun, 2006 02:09:52 Top
Brad Smith




Posts: 49
Joined: 2005-11-22
The Ctrl+R shortcut can be overrided too.
It can be done via the ADXKeyboardShortcut component added in the latest ADX version.

Hmm, I think I'm missing some critical bit of info. I added in the above handler, and when I hit Ctrl-R I do indeed go into my handler.

The problem is, the default action for Ctrl-R doesn't happen. Normally I'd expect some sort of EventArgs parameter, for which I'd set e.Handled to either true or false to allow Outlook's default handler to continue after my pre-processing.

Am I missing some critical bit of info? I'm going through the docs (and searched here) but can't find any obvious clues.

Brad.

P.S. I'm using the shiny new v2.6
Posted 16 Jun, 2006 09:20:38 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Brad, you are right. The default action doesn't work if you override it via ADXKeyboardShortcut component. In fact it is not possible to control the default behaviour of Outlook. You can only disable the standard action and then implement it in the add-in code using the Outlook Object Model.
Posted 18 Jun, 2006 13:01:39 Top
Brad Smith




Posts: 49
Joined: 2005-11-22
Thanks. I'm glad I found that early. For my specific situation I can deal with this by trapping the key, doing my thing and then calling the default action programmatically (I only need to deal with Reply, ReplyAll & Forward).
Posted 19 Jun, 2006 11:48:41 Top