This documentation is archived and is not being maintained.

Documents Interface

Contains all Document objects in the environment, each representing an open document.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

public interface Documents : IEnumerable

The Documents type exposes the following members.

Public propertyCountGets a value indicating the number of objects in the Documents collection.
Public propertyDTEGets the top-level extensibility object.
Public propertyParentGets the immediate parent object of a Documents collection.

Public methodAddInfrastructure. Microsoft Internal Use Only.
Public methodCloseAllCloses all open documents in the environment and optionally saves them.
Public methodGetEnumeratorReturns an enumerator for items in the collection.
Public methodItemReturns an indexed member of a Documents collection.
Public methodOpenInfrastructure. Microsoft Internal Use Only.
Public methodSaveAllSaves all documents currently open in the environment.

Reference this collection by using DTE.Documents.

Sub DocumentsExample()
   ' Closes all saved documents.
   Dim iDoc As Integer
   For iDoc = 1 To DTE.Documents.Count
      If DTE.Documents.Item(iDoc).Saved Then
      End If
   Next iDoc
End Sub