WD: How to Exit Windows from Word Using ExitWindows
ID: Q71012
|
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 95, versions 7.0, 7.0a
SUMMARY
You can use the ExitWindows macro command to exit Windows from Word for
Windows. This command is not documented in the "Microsoft Word Technical
Reference for Word for Windows and OS/2" (Word 1.x) or "Using WordBasic"
(Word 2.0). It is documented in the "Microsoft Word Developer's Kit" for
Word for Windows version 6.0 and for Word for Windows 95, version 7.0.
MORE INFORMATION
If you run a macro that includes the ExitWindows command, Word for Windows
does NOT prompt you to save the document or global, glossary, and command
changes. As a result, document modifications, glossaries, macros, and even
the macro that calls the ExitWindows command itself can be lost if you run
the ExitWindows command.
To use this command within Word for Windows and still be prompted to save
any changes made during the current session, you can use an AutoExit macro
to exit Windows when you exit Word for Windows. The AutoExit macro runs
each time you close Word for Windows.
To create this macro, use the appropriate procedure below.
Word 7.0
- On the Tools menu, click Macro.
- In the Macro Name box, type AutoExit, and then click Create.
- On the line between Sub Main and End Sub, type ExitWindows. The complete macro should read as follows:
Sub Main
ExitWindows
End Sub
- On the File menu, click Close. When prompted to save changes,
click Yes.
- On the File menu, click Save All. When prompted to save global
glossary and command changes, click Yes.
Word 6.x
- On the Tools menu, click Macro.
- In the Macro Name box, type AutoExit, and then click Create.
- Type ExitWindows on the line
between Sub Main and End Sub. The complete macro should read as
follows:
Sub Main
ExitWindows
End Sub
- On the File menu, click Close. When prompted to save changes, click Yes.
- On the File menu, click Save All. When prompted to save global
glossary and command changes, click Yes.
Word 2.x
- On the Tools menu, click Macro.
- In the Macro Name box, type AutoExit, and then click Edit.
- Type ExitWindows on the line
between Sub Main and End Sub. The complete macro should read as
follows:
Sub Main
ExitWindows
End Sub
- On the File menu, click Close. When prompted to save changes,
click Yes.
- On the File menu, click Save All. When prompted to save global
glossary and command changes, click Yes.
Word 1.x
- From the Macro menu, choose Edit.
- In the Edit Macro Name box, type AutoExit, then choose the OK button.
- Type ExitWindows on the line
between Sub Main and End Sub. The complete macro should read as
follows:
Sub Main
ExitWindows
End Sub
- From the File menu, choose Close. When prompted to keep changes to
Global: autoexit, choose the Yes button.
- From the File menu, choose Exit. When prompted to save global
glossary and command changes, choose the Yes button.
REFERENCES
"Microsoft Word for Windows User's Reference," version 1.x, pages
187-189
Additional query words:
Keywords : kbmacro kbusage kbwordvba winword word6 winword2 word7 word95 kbhowto
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
Platform : WINDOWS
Issue type :
|