Documents Interface
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Documents Interface

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

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

[GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")] 
public interface Documents : IEnumerable
/** @attribute GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4") */ 
public interface Documents extends IEnumerable
GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4") 
public interface Documents extends IEnumerable

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
         DTE.Documents.Item(iDoc).Close()
      End If
   Next iDoc
End Sub
Show:
© 2016 Microsoft