Ty Anderson

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.

1024x768

800x600

6 Comments

  • https://secure.gravatar.com/avatar/8f1dfe7d812ef71fcd86beec8ab1278b?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Dzmitry says:

    Does Addin Express supports keyboard shortcuts in Office 2013 (Excel, PowerPoint, Word)?

  • https://secure.gravatar.com/avatar/ab4ec2858cfdf1e44dadf8c50fae314d?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Dmitry Kostochko (Add-in Express Team) says:

    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.

  • https://secure.gravatar.com/avatar/4e52a0d25d19cb063324da525ba4ca61?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Raghunathan s says:

    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

  • https://secure.gravatar.com/avatar/29957f26ad2d8ba527fd9cc8cfa7b2e0?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Andrei Smolin (Add-in Express Team) says:

    Hello Raghunathan,

    Ctrl+F11 doesn’t work for me in Outlook 2016 with all COM add-ins turned off.

  • https://secure.gravatar.com/avatar/4e52a0d25d19cb063324da525ba4ca61?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Raghunathan s says:

    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

  • https://secure.gravatar.com/avatar/29957f26ad2d8ba527fd9cc8cfa7b2e0?s=32&d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D32&r=G Andrei Smolin (Add-in Express Team) says:

    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;
    }

Post a comment

Have any questions? Ask us right now!