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

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

Additional query words: 2.0 winword2 6.0 word6 word7 winword 7.0 word95

Keywords :
Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0b,2.0c,6.0,6.0a,6.0c,7.0
Platform : WINDOWS
Issue type :


Last Reviewed: December 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.