Поделиться через


Tasks.ExitWindows Method

Word Developer Reference

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 Office 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.

Visual Basic for Applications
  Documents.Save NoPrompt:=True, _
    OriginalFormat:=wdOriginalDocumentFormat
Tasks.ExitWindows

See Also