Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DTE Interface

Definition

Namespace:
EnvDTE
Assembly:
EnvDTE.dll
Assembly:
Microsoft.VisualStudio.Interop.dll
Package:
Microsoft.VisualStudio.Interop v17.14.40260

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public interface class DTE : EnvDTE::_DTE
public interface class DTE
public interface class DTE : EnvDTE::_DTE
__interface DTE : EnvDTE::_DTE
[System.Runtime.InteropServices.CoClass(typeof(EnvDTE.DTEClass))]
[System.Runtime.InteropServices.Guid("04A72314-32E9-48E2-9B87-A63603454F3E")]
public interface DTE : EnvDTE._DTE
[System.Runtime.InteropServices.Guid("04A72314-32E9-48E2-9B87-A63603454F3E")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface DTE
[<System.Runtime.InteropServices.CoClass(typeof(EnvDTE.DTEClass))>]
[<System.Runtime.InteropServices.Guid("04A72314-32E9-48E2-9B87-A63603454F3E")>]
type DTE = interface
 interface _DTE
[<System.Runtime.InteropServices.Guid("04A72314-32E9-48E2-9B87-A63603454F3E")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type DTE = interface
Public Interface DTE
Implements _DTE
Public Interface 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