_DTE 介面
更新:2007 年 11 月
在 Visual Studio Automation 物件模型中最上層的物件。請參考 _DTE 以了解這項功能,請勿從這個類別執行個體化。
命名空間: EnvDTE
組件: EnvDTE (在 EnvDTE.dll 中)
語法
<GuidAttribute("04A72314-32E9-48E2-9B87-A63603454F3E")> _
Public Interface _DTE
Dim instance As _DTE
[GuidAttribute("04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface _DTE
[GuidAttribute(L"04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface class _DTE
public interface _DTE
備註
_DTE 物件是由在建立增益集時實作的 OnConnection 方法所提供。_DTE 物件是 Visual Basic 中的 Application 物件。
若要存取像是 VBProjects 或 CSharpProjects 的特定專案屬性,請使用 DTE.GetObject("VBProjects") 語法。
如需關於參考 EnvDTE 命名空間與 _DTE 物件的詳細資訊,請參閱 HOW TO:取得參考至 DTE 和 DTE2 物件。
範例
Sub DTEExample()
Dim objTextDoc As TextDocument
Dim objEP As EditPoint
'Create a new text document.
DTE.ItemOperations.NewFile("General\Text File")
'Get a handle to the new document.
Set objTextDoc = DTE.ActiveDocument.Object("TextDocument")
Set objEP = objTextDoc.StartPoint.CreateEditPoint
'Create an EditPoint and add some text.
objEP.Insert "A test sentence."
End Sub