Tasks.ExitWindows Method (Word)
Closes all open applications, quits Microsoft Windows, and logs the current user off.
Syntax
expression .ExitWindows
expression Required. A variable that represents a Tasks collection.
Remarks
This method does not save changes to open Microsoft Word documents; however, it does prompt you to save changes to open documents in other Windows-based applications.
Example
This example saves all open Word documents, closes Word, and then quits Microsoft Windows.
Documents.Save NoPrompt:=True, _
OriginalFormat:=wdOriginalDocumentFormat
Tasks.ExitWindows