WinWord: FileExit Command Does Not Run When You Press ALT+F4

Last reviewed: July 30, 1997
Article ID: Q87430
The information in this article applies to:
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0

SUMMARY

You can exit Microsoft Word for Windows by choosing Exit from the File menu, pressing ALT+F4, or choosing Close from the Application Control menu. Of these methods: File, Exit and ALT-F4 call the FileExit WordBasic command. Clicking Close from the Applications Control menu does not.

Therefore, if you want to run additional WordBasic macro commands whenever you exit Word for Windows, do not modify the FileExit command. To ensure that additional macro commands always run, create a global AutoExit macro instead.

The functionality of the FileExit command is by design.

MORE INFORMATION

To make sure your AutoExit macro is stored globally, choose Template from the File menu. Under "Store New Macros and Glossaries as," select either the Global option button or the Prompt For Each New option button, then choose the OK button.

Sample AutoExit Macro

   Sub Main
   Chdir "C:\DOS"
   MsgBox "Changing directory to the C: Drive, DOS subdirectory"
   End Sub

The above macro runs anytime you exit Word for Windows using one of the methods described above.

For more information, query on the following words in the Microsoft Knowledge Base:

    and auto

REFERENCES

"Microsoft Word for Windows User's Guide," version 2.0, pages 768-784, 786

"Using WordBasic," by WexTech Systems and Microsoft, pages 87, 175, 196, 360

"Microsoft Word for Windows User's Reference," version 1.x, pages 186-189

"Microsoft Word for Windows and OS/2 Technical Reference," version 1.x, pages 97-99, 171

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: 2.0 2.0a 2.0a-CD winword2 6.0 word6
word7 winword 7.0 word95 winword
Version : 2.x 6.0 6.0a 6.0c 7.0
Platform : WINDOWS


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: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.