Video: Handling Office keyboard shortcuts
For almost every menu and/or Ribbon command in Microsoft Office, there is a keyboard shortcut for it. These shortcuts allow you to quickly and easy execute a command with a key stroke that might take several clicks of the mouse.
As you build COM add-ins for Office, it's a good idea to add your own keyboard shortcuts as it will add to the user's experience and increase their overall satisfaction with your add-in solution.
Add-In-Express for Microsoft Office and .NET provides a quick and easy way for you to add custom keyboard shortcuts to your add-ins. This video shows how to do it. As a bonus, the video also shows how to handle a special situation that involves Excel, custom task panes, and keyboard shortcuts.
In addition to watching this video, I recommend that you read the following article:
Advanced Excel task panes (especially the Keyboard and Focus section)
This sample video was captured in Visual Studio 2010 with Add-in Express for Microsoft Office and .NET.
6 Comments
Does Addin Express supports keyboard shortcuts in Office 2013 (Excel, PowerPoint, Word)?
Hi Dzmitry,
Yes, it does. You can add the ADXKeyboardShortcut component to your add-in module, set in the ShortcutText property and handle the Action event.
Hi Dmitry
I’ve created an add-in for Outlook (2010, 2013 & 2016) when the add-in placed in the DockTop Explorer Layout.
Now, if the focus is inside the Add-in, i am unable to use the Outlook’s default Keyboard Shortcuts (for example: Ctrl+F11 – to expand / collapse the top outlook ribbon)
How to handle this, any help would be appreciated.
Regards
Raghunathan S
Hello Raghunathan,
Ctrl+F11 doesn’t work for me in Outlook 2016 with all COM add-ins turned off.
Hello Andrei
Sorry, it was a typo, keyboard shortcut is Ctrl+F1 (not F11). this happens when the cursor focus is inside the Add-in.
If the focus is in Outlook Grid, folder or any other control outside the Plugin, it works fine.
Similarly any Keyboard shortcuts like , Ctrl+Spacebar doesn’t work when the focus is in the add-in. How to bypass this
Regards
Raghunathan S
Hello Raghunathan,
Try this approach:
private void ADXOlForm1_ADXKeyFilter(object sender, ADXOlKeyFilterEventArgs e)
{
if (e.Control && (e.KeyCode == Keys.F1 || e.KeyCode == Keys.Space || e.KeyCode == Keys.N))
e.Action = ADXOlKeyFilterAction.SendToHostApplication;
}