Turning ADXRibbonCommand or ADXKeyboardShortcut on or off

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

Turning ADXRibbonCommand or ADXKeyboardShortcut on or off
 
Tim Farrelly


Guest


Can you please confirm
1. that when you add either an ADXRibbonCommand or an ADXKeyboardShortcut that the Word command or the Word keyboard short cut is always intercepted by the AddinModule
2. that setting the Enabled property to false does not re-enable the command or the keyboard short cut for Word
3. that setting the Enabled property to false on an ADXKeyboardShortcut only prevents the event from being raised to the module

If the answer is yes to the above then
1. Is there a way to turn the ADXRibbonCommand on or off, so that when "on" my module takes control of the command and when "off" Word takes control. So the command is enabled either way.
2. Is there a way to turn the ADXKeyboardShortcut on or off, so that when "on" my module gets the event and takes control and when "off" Word gets the event and takes control.

Thanks
Posted 05 Sep, 2016 04:04:32 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hello Tim,

There are two ways in which the ADXRibbonCommand component deals with a Ribbon command built in an Office application:
- you can disable the command. Setting ADXRibbonCommand.Enable= false disables the corresponding control(s) in the Ribbon UI.
- if the command is enabled, you can intercept user's invoking the command and (optionally) cancel the command.

The ADXKeyboardShortcut component allows intercepting the key combination that you specify. The component intercepts the combination so that host application doesn't receive it; if the business logic requires that the shortcut is interpreted by the host application, you can invoke the corresponding method from the object model. Setting ADXKeyboardShortcut.Enable influences the component only.

#1. ADXRibbonCommand.Enable=True makes the command enabled in the Ribbon. Your add-in can intercept the OnAction event and cancel it. This will cancel the command globally: no add-in will be able to override this behavior. turning your add-in off will let the command work correctly.

#2. See the explanation above.


Andrei Smolin
Add-in Express Team Leader
Posted 05 Sep, 2016 08:36:22 Top
Tim Farrelly


Guest


Ok, thank you.
Posted 05 Sep, 2016 23:38:17 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Welcome!


Andrei Smolin
Add-in Express Team Leader
Posted 06 Sep, 2016 02:45:49 Top