Microsoft KB Archive/73113

{|
 * width="100%"|

WD: Using RecordNextCommand Macro When Writing WordBasic Macros

 * }

Q73113

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, versions 7.0, 7.0a
 * Microsoft Word for the Macintosh, versions 6.0, 6.0.1

-

SUMMARY
It is possible to use the RecordNextCommand macro to record the syntax of the next WordBasic command executed into an open macro window in Microsoft Word.

MORE INFORMATION
The RecordNextCommand macro can be helpful when you are writing a macro and are unsure of the syntax for a particular command. The RecordNextCommand will insert the syntax of the next command executed into the open macro window.

Word versions 6.x, 7.x
To activate the RecordNextCommand in Word for Windows 6.0 and 7.0, do the following:


 * 1) In the Macro Editor, place the insertion point at the spot where you want the recorded command to begin.
 * 2) Switch to an open document window from the Window menu or by pressing CTRL+F6 (COMMAND+F6 in WORD for the Macintosh), or open a new document.
 * 3) From the Macro Editor toolbar, which is still showing above the Ruler, press the button second from left, a dot with a number &quot;1&quot; next to it. (If you're not sure which button, the Toolbar Hint will say &quot;RecordNextCommand&quot; when your mouse pointer is positioned on the button.)
 * 4) Your mouse pointer will show an icon resembling an audio cassette, to indicate that the Macro Recorder is active.
 * 5) Perform the action that is to be recorded into your macro. (You can re-press the button to abort the recording.)
 * 6) Once the command is completed, the recorder will place the command syntax into the macro window. Switch back to the open macro sheet to view the recorded syntax.

There is no pre-assigned shortcut key for RecordNextCommand in Word for Windows version 6.x. For information about creating a shortcut key or assigning RecordNextCommand to a menu or toolbar, refer to pages 716-728 of the Microsoft Word for Windows version 6.0 &quot;User's Guide.&quot;

Word for Windows version 2.x
To activate the RecordNextCommand in Word for Windows 2.x, do the following:


 * 1) Switch to an open document window from the Window menu or open a document. (Make sure that you have a macro window open as well by choosing Edit from the Macro menu, giving a name to your macro, and then pressing ENTER.)
 * 2) On the Tools menu, click Macro and press ALT+C to select the Commands option button in the Show box.

This selects all macro commands.
 * 1) Select RecordNextCommand from the list of available macros and press ENTER. (Make sure that you have opened a macro menu at this point by selecting Macro from the Tools menu and giving your macro a name. Choose Edit to open a macro window).
 * 2) &quot;REC&quot; will now appear in the status bar at the bottom of the Word for Windows screen to indicate that the Macro Recorder is active.
 * 3) Perform the command that is to be recorded into the macro sheet.

Word for Windows versions 1.x
To use the RecordNextCommand macro in Word for Windows version 1.x, position the cursor on the line where the recorded syntax should appear in the macro window, and do the following:


 * 1) Switch to an open document window from the Window menu or open a document. (Make sure that you have a macro window open as well by choosing Edit from the Macro menu, giving a name to your macro, and then pressing ENTER.)
 * 2) On the Macro menu, click Run and press ALT+A to select the Show All check box (if not already selected).
 * 3) Select RecordNextCommand from the list of available macros and press ENTER.
 * 4) &quot;REC&quot; will now appear in the status bar at the bottom of the Word for Windows screen to indicate that the Macro Recorder is active.
 * 5) Perform the command that is to be recorded into the macro sheet.

Once the command is completed, the recorder will place the command syntax into the macro window. Switch back to the open macro sheet to view the recorded syntax.

NOTE: If no macro windows are open, the RecordNextCommand macro will beep when executed.

The RecordNextCommand macro can be added to the Macro menu by using the Assign To Menu function (refer to page 195 of the &quot;Microsoft Word for Windows User's Reference&quot; for more information on adding macros to menus).