DTE Interface

Definition

The top-level object in the Visual Studio automation object model. The documentation for the _DTE type is the most complete.

[System.Runtime.InteropServices.CoClass(typeof(EnvDTE.DTEClass))]
[System.Runtime.InteropServices.Guid("04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface DTE : EnvDTE._DTE
Derived
Attributes
Implements

Examples

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  

Remarks

For details about referencing the EnvDTE namespace and the DTE object, see FAQ: Converting Add-ins to VSPackage Extensions.

Applies to