Share via


Documents Interface

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

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

Syntax

'Declaration
<GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")> _
Public Interface Documents _
    Inherits IEnumerable
'Usage
Dim instance As Documents
[GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")]
public interface Documents : IEnumerable
[GuidAttribute(L"9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")]
public interface class Documents : IEnumerable
public interface Documents extends IEnumerable

Remarks

Reference this collection by using DTE.Documents.

Examples

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

See Also

Reference

Documents Members

EnvDTE Namespace

Document