GoBack Command Switches to Another Document

ID: Q101453

The information in this article applies to:

SYMPTOMS

If you run the GoBack command in a WordBasic macro, or by pressing SHIFT+F5, Word for Windows may switch to another open document.

CAUSE

This behavior occurs because the GoBack command operates at the Word session level rather than the Word document level. In other words, GoBack toggles between the last three selections where text or formatting has changed in any document that is still open.

As a result, the GoBack macro may go to an unexpected location whenever more than one document is open in Word. For example, if you use the GoBack command in an AutoOpen macro to position the insertion point at its last editing position, Word may position the insertion point in another open document instead. The following is a sample AutoOpen macro that uses the GoBack command:

   Sub MAIN
      GoBack
   End Sub

MORE INFORMATION

The GoBack WordBasic command switches among the last three locations in currently open documents in which text or formatting has changed. The GoBack command is the equivalent of pressing SHIFT+F5 in a Word for Windows document. If only one document is open, the GoBack command switches among the last three selections in that document.

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

   ARTICLE-ID: Q160021
   TITLE     : Word 97: Goback Method Switches to Another Document


REFERENCES

"Using WordBasic," by WexTech Systems and Microsoft, page 229

"Microsoft WordBasic Primer," Russell Borland, pp. 67-68

Kbcategory: kbusage kbmacro KBSubcategory: Additional query words: 2.0 2.0a 2.0a-CD 2.0b 2.0c 1.0 1.10 winword 7.0 word95 word7 word6 1.10a winword2 6.0

Version           : 1.x 2.x 6.0 6.0a 6.0c 7.0 7.
Platform          : WINDOWS

Last Reviewed: July 30, 1997