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 型別會公開下列成員。
回頁首
名稱 | 說明 | |
---|---|---|
![]() |
Add | 基礎架構。僅限 Microsoft 內部使用。 |
![]() |
CloseAll | 關閉環境中所有開啟的文件,並選擇性存檔。 |
![]() |
GetEnumerator() | 傳回會逐一查看集合的列舉程式。 (繼承自 IEnumerable)。 |
![]() |
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