Accessing a Ms Office PowerPoint 2010 ribbon button using a shortcut. RRS feed

  • Question

  • Hi Every body i'm new to programming, I'm in the process of creating shortcuts for PowerPoint controls (C#.Net). I want to execute controls using shortcuts. For inbuilt controls we can use "ExecuteMso", But for custom com-addin controls I dont know how to execute them. Is there any other option to access a ribbon control directly through code. 

    Note: I know the namespace of the custom com-addin.

    Wednesday, October 3, 2012 9:49 AM


  • Hi rokr

    Supplementing Quist Zhangs reply:

    Keyboard shortcuts can only be assigned directly to code when this code is VBA code. (Even then, I'm not sure it's possible for PowerPoint).

    Other than assigning keytips to Ribbon controls, which is not 100% reliable, the only other possibility is to use the Windows API to implement "keyboard hooks" and map these to your code.

    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 4, 2012 8:57 AM
  • Hi rokr

    It's not possible to link keyboard hooks directly to the Ribbon controls, as far as I know. But you might want to check whether the RIbbon Accessibility APIs have something for that:


    Beyond that, you'd have to construct the code in your add-in a bit differently. Don't put the code that actually performs actions in the callback methods. Instead, have the callback methods call a separate method that can also be called by the keyboard hook.

    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, October 4, 2012 10:29 AM

All replies