There comes a point, in using Microsoft Word, where you realize you’re more productive using your keyboard than a mouse, and very often, it’s easy to encapsulate a mouse action into a keyboard-activated macro.
For example, the text I translate often involves superscripts and subscripts, for which Word helpfully offers toolbar buttons. The following one-line macros let me superscript highlighted text without taking my fingers from the keyboard:
Sub AA_ToSuperscript()
'
' AA_ToSuperscript Macro
'
Selection.Font.Superscript = wdToggle
End Sub
Two additional observations about this macro:
- setting Selection.Font.Superscript to wdToggle means that if you execute the macro again, the superscripted text will be returned to normal;
- prefixing the names of my personal macros with AA_ groups them all at the top of the macro list, should I care to display it.
The macro for subscripting is a simple variation on a theme, with Selection.Font.Subscript replacing Selection.Font.Superscript in the above code.
Do you have any nifty Word macros that you’d like to share? Post ‘em in the comments!