A family of Microsoft word processing software products for creating web, email, and print documents.
Word does not expose any VBA object model to move the keyboard focus between ribbon controls or to “select the next icon” on the ribbon after pressing Enter. Ribbon controls can run macros when clicked or activated, but VBA cannot programmatically shift focus from one ribbon button to another.
What can be done instead is:
- Use keyboard navigation that Word already provides for the ribbon:
- Press Alt or F10 to activate the ribbon and show KeyTips.
- Use Left/Right Arrow to move between tabs and Ctrl+Left/Right Arrow to move between groups.
- Use Tab/Shift+Tab or the Arrow keys to move between commands on the ribbon.
- Press Spacebar or Enter to activate the selected command.
- If the goal is to run two commands/macros in sequence, combine the logic into a single macro and assign that macro to one ribbon button, instead of trying to move focus to the next button.
Because the ribbon is not programmable at the focus/selection level through VBA, automatically moving the cursor to the next ribbon icon after Enter is not possible.
References: