@winhelp3 on Twitter


Q Macro

Let's face it you can write a lot of MSWord macros and then forget where you put them, what you called them and too often they are not quite right the next time you want to do something.
The solution is to write the same macro each time, I call it the Q macro. It typically finds and corrects each instance of something or starts with a selection (from a previous search) takes a series of actions and then does that search again and leaves you with the next instance of that search selected. You then make the decision whether to run the macro over that next instance.

Q Macro logic
The macro always follows the same logic.
Use a keyboard shortcut to run a macro to perform a task (on selected text)
The macro includes a move to a next instance using "find"
It also makes whatever movements are necessary to select the exact text to perform the task (above)
To write the macro
Select the text
Tool > Macro > Record New Macro
Macro name is always the same* and keyboard shortcut is always the same Alt+Q
Perform the task (use the keyboard in preference to the mouse)
Ctrl+F to open the Find dialog
Enter the text to find
Select the exact text to perform the task (use the keyboard)
End Macro
To run the macro
Select the text and press Alt+Q to perform the task. The task will be performed and another instance will be found and selected.
If you do not want to perform the task on the selected text then press the MSWord search buttons on the scroll bar (or Ctrl+Page down) to find the next instance.
Then select the text needed for the start of the macro.

Always the Same
Always make the macro name the same - you can find it easily if I need to edit it. Alt+F8 > Q
Overwrite any old instances because each macro is in some way different from the previous macro.
Always make the keyboard shortcut the same - Alt+Q is a very easy key combination with the left hand.

This item also appears in the xdk_hdk users group FAQ pages: