This documentation is archived and is not being maintained.

HTMLWindow.DTE Property

Gets the top-level extensibility object.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

DTE DTE { get; }
/** @property */
DTE get_DTE ()

function get DTE () : DTE

Property Value

A DTE object.

In Visual Studio, the DTE object is the root of the automation model, which other object models often call "Application."

public void CodeExample(DTE2 dte, AddIn addin)
   // Make sure you have an open HTML document before running this example
        if (dte.ActiveDocument.ActiveWindow.Object is HTMLWindow)
            HTMLWindow htmlwin;
            string msg = "";
            htmlwin = dte.ActiveDocument.ActiveWindow.Object as HTMLWindow;
            // Show the related application object's name.
            msg += "The application containing this HTMLWindow is " + htmlwin.DTE.Name;
            // Show the HTMLWindow's parent object.
            msg += "\nThe HTMLWindow's parent object is " + htmlwin.Parent.Type.ToString();
    catch(Exception ex)