Documents 接口

包含环境中的所有 Document 对象,每个对象表示一个打开的文档。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
<GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")> _
Public Interface Documents _
    Inherits IEnumerable
[GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")]
public interface Documents : IEnumerable
[GuidAttribute(L"9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")]
public interface class Documents : IEnumerable
[<GuidAttribute("9E2CF3EA-140F-413E-BD4B-7D46740CD2F4")>]
type Documents =  
    interface 
        interface IEnumerable 
    end
public interface Documents extends IEnumerable

Documents 类型公开以下成员。

属性

  名称 说明
公共属性 Count 获取一个值,该值指示 Documents 集合中对象的数目。
公共属性 DTE 获取顶级扩展性对象。
公共属性 Parent 获取 Documents 集合的直接父对象。

页首

方法

  名称 说明
公共方法 Add 基础结构。 仅由 Microsoft 内部使用。
公共方法 CloseAll 关闭环境中所有打开的文档并可选择保存它们。
公共方法 GetEnumerator 返回集合中项的枚举数。
公共方法 Item 返回 Documents 集合的一个索引成员。
公共方法 Open 基础结构。 仅由 Microsoft 内部使用。
公共方法 SaveAll 保存环境中当前打开的所有文档。

页首

备注

使用 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

请参阅

参考

EnvDTE 命名空间

Document