Document objects are used to represent an open document in the IDE. To contrast this abstraction with that provided by the
Window object, a
Window object is used to represent the physical UI aspects of a document window, whereas a
Document object is used to represent the physical document that is being displayed within that document window.
A document could be a designer, such as the Windows Forms Designer, or it could be a text-based document such as a ReadMe file or a C# code file open in an editor.
Just as you get a list of all open windows using the
DTE.Windows collection, you can use the
DTE.Documents collection to retrieve a list of all open documents.
Dim documents As Documents = DTE.Documents