I've seen similar questions asked, but did not manage to find an answer to my specific problem.
I have in place a custom ribbon tab, with custom buttons. Their purpose is to each insert a QuickPart in the document.
As I have a lot of different QuickParts to be inserted, I didn't want to create a macro for each and every one.
So, when a user select an item in the ribbon, a single macro is called on, which uses the control.ID
property to insert the appropriate QuickPart.
Everything works well, but now I'm asked to add keyboard shortcuts for some of these ribbon items.
Here's what I have until now:
The macro that inserts QuickParts:
Sub TalkToRibbon(control As IRibbonControl) ... End Sub
When a shortcut is pressed, this macro is triggered:
Sub interac_obj_cart() shortcut = "interac_obj_cart" TalkToRibbon(shortcut) End Sub
Whether I define "shortcut" as a String
or as a IRibbonControl
, I get error messages (albeit different). I feel like there is something I am missing. Thanks in advance for your help