This documentation is archived and is not being maintained.

CloseAll Method

Visual Studio .NET 2003

Closes all open documents in the environment and optionally saves them.

[Visual Basic .NET]
Public Sub CloseAll( _
   Optional ByVal Save As vsSaveChanges = vsSaveChangesPrompt _
) 
[Visual Basic 6]
Sub CloseAll( _
   Optional ByVal Save As vsSaveChanges = vsSaveChangesPrompt _
) 
[C++]
HRESULT __stdcall CloseAll(
   vsSaveChanges Save
);
[C#]
public void CloseAll(
   vsSaveChanges Save
);
[JScript .NET]
public function CloseAll(
   Save : vsSaveChanges
)

Parameters

Save
Optional. A vsSaveChanges constant representing how to react to changes made to documents.

Example

Sub CloseAllExample()
  ' Before running, create a text file or other document window.
  Dim docs As Documents
  Dim doc As Document
  Dim win As Window

  docs = documents
  docs.SaveAll()
  doc = dte.ActiveDocument
  win = doc.NewWindow()
  doc.Save("c:\temp\docsave.txt")
  msgbox(doc.Selection().text)
  docs.CloseAll(vsSaveChanges.vsSaveChangesPrompt)
End Sub

See Also

Close Method (General Extensibility)

Applies To: Documents Collection

Show: