WD: No "Pause" Command in WordBasic

Last reviewed: February 2, 1998
Article ID: Q74630
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 NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Word for the Macintosh, versions 6.0, 6.0.1

SUMMARY

In WordPerfect there is a macro command called PAUSE that suspends the macro for user input until the user presses ENTER, at which point the macro continues. There is no WordBasic command to pause a running macro in this manner.

The "More Information" section of this article discusses a method you can use to simulate the functionality of the PAUSE command.

MORE INFORMATION

To simulate this behavior in Word, use one of the following methods.

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Method 1: Use macros and an Assigned Key Command

Create two macros; the first will end at the pause, the second will start after the pause.

Reassign the ENTER key to run the second macro by adding the following line to the end of the first macro, where "xxxx" is the name of the second macro:

   ToolsCustomizeKeyboard .KeyCode = 13, .Category = 2, \
   .Name = "xxxx", .Add

Add the following line to the beginning of the second macro, where "xxxx" is the name of the second macro:

   ToolsCustomizeKeyboard .KeyCode = 13, .Category = 2, \
   .Name = "xxxx",  .Remove

Method 2: Use a Message Box

Insert a MsgBox command at the point where you want to pause to allow user intervention. This MsgBox should prompt the user to press a certain key combination (such as CTRL+Z) when ready to resume the macro.

Place the commands for the remainder of the macro into another macro and assign it the key combination referenced in the MsgBox. When you press this key combination, this macro runs, creating a pause effect between the first and second macro.

For information about how to do this in Word 97, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q159484
   TITLE     : Simulating a Macro Pause in Word 97

REFERENCES

"Microsoft Word for Windows Technical Reference," page 77

"Microsoft Word for Windows and OS/2 Technical Reference," pages 224-225


Additional query words: pausing

Keywords : kbmacroexample macword ntword winword winword2 word6 word7 word95 wordnt kbmacro
Version : WINDOWS:1.0,1.1,1.1a,2.0,2.0a,2.0a- CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 2, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.