1.5. Recording a Sample Word Macro

In this section, you'll record a sample macro in Word that you can work with later. This macro selects the current word, cuts it, moves the insertion point one word to the right, and pastes the word back in. This is a straightforward sequence of actions that you'll later view and edit in the Visual Basic Editor.

Follow these steps to record the macro:

  1. Create a new document by pressing Alt+F, N.

  2. Start the Macro Recorder by opening the Developer tab on the Ribbon, then clicking the Record Macro button. Or click the Macro Record button on the status bar at the bottom of the application (with this approach, you don't have to open the Developer tab — just click the button on the status bar).

  3. In the Macro Name text ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.