ExitWindows Method

Microsoft Word Visual Basic

Closes all open applications, quits Microsoft Windows, and logs the current user off. This method doesn't save changes to open Word documents; however, it does prompt you to save changes to open documents in other Windows-based applications.

expression.ExitWindows

expression    Required. An expression that returns a Tasks object.

Example

This example saves all open Word documents, quits Word, and then quits Microsoft Windows.

Documents.Save NoPrompt:=True, _
    OriginalFormat:=wdOriginalDocumentFormat
Tasks.ExitWindows