How to Combine Word Commands into One Macro Keyboard Shortcut
Question details
The user wants to combine multiple commands, like switching views and running hyphenation, into a single custom keyboard shortcut using a macro.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Streamlining repetitive formatting tasks by executing sequential actions with just one keystroke.
- Observed behavior
- Currently, actions like changing document views and accessing tools require multiple clicks or separate shortcuts; the goal is to merge these into a unified automated command.
Ensure that the Developer tab is enabled in your word processor's ribbon, as you will need it to record or edit the macro and assign keyboard shortcuts.
Record a Macro and Assign a Custom Shortcut
The most straightforward method to combine actions is to use the macro recorder to capture your sequence, then assign a specific shortcut key to trigger it.
By recording your actions, you do not need to write any VBA code manually. The application will track your clicks—such as switching to Print Layout and running the hyphenation tool—and save them as a unified script.
Navigate to the Developer tab on the ribbon and click 'Record Macro'.
In the Record Macro dialog box, click on the 'Keyboard' button to assign a custom keyboard combination for your new macro.
Switch your document view from Draft to Print Layout, then run the Hyphenation command from the Layout tab.
Go back to the Developer tab and click 'Stop Recording'. Your shortcut will now trigger both actions sequentially.

Write a VBA Script to Combine Commands
For users who need precise control, you can directly write the VBA script to execute the view change and hyphenation process, then link it to a shortcut.
Use WPS Writer to Automate Tasks with Macros
WPS Writer offers full macro functionality, making it exceptionally easy to record sequential commands and assign custom keyboard shortcuts without any coding required.
- 1. Enable the Developer Tab: Open WPS Writer, right-click the ribbon, and customize it to display the Developer tab.
- 2. Record Macro: Click 'Record Macro', name your macro, and enter your desired shortcut key.
- 3. Perform Actions: Switch your view and apply hyphenation, then click 'Stop Recording'.
- 4. Test Shortcut: Press your customized shortcut combination to instantly apply all recorded actions at once.

Frequently Asked Questions
Can I override an existing default Word shortcut with my new macro?
Yes, when you assign a keyboard shortcut to a macro in the customization menu, it automatically overwrites any default application command that was previously assigned to those keys.
Why does my recorded hyphenation macro fail to run on a different computer?
VBA commands and macro recordings for tools like hyphenation often depend on your specific software version and language settings. If the target dictionary differs, the macro may require adjustments.
Do I need to learn VBA coding to combine shortcuts?
No. You can easily use the built-in 'Record Macro' feature to capture your physical clicks and assign them to a key, completely bypassing the need to write custom VBA code.
How do I remove or change the keyboard shortcut assigned to a macro?
Navigate to File > Options > Customize Ribbon, then click the 'Customize' button for Keyboard shortcuts. Find your macro in the list, select the current key binding, and click 'Remove'.




