TextDocument Interface

 

Represents a text file open in the editor.

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

<GuidAttribute("CB218890-1382-472B-9118-782700C88115")>
Public Interface TextDocument

NameDescription
System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyEndPoint

Gets a TextPoint object that is the location of the end of the document.

System_CAPS_pubpropertyIndentSize

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

System_CAPS_pubpropertyLanguage

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

System_CAPS_pubpropertyParent

Gets the immediate parent object of a TextDocument object.

System_CAPS_pubpropertySelection

Gets an object representing the current selection on the TextDocument object.

System_CAPS_pubpropertyStartPoint

Gets the TextPoint object representing the beginning of the text document, or the first displayed character of the pane.

System_CAPS_pubpropertyTabSize

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

System_CAPS_pubpropertyType

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

NameDescription
System_CAPS_pubmethodClearBookmarks()

Removes all unnamed bookmarks in the text document.

System_CAPS_pubmethodCreateEditPoint(TextPoint)

Creates an EditPoint object at the specified location and returns it. The default location is the beginning of the document.

System_CAPS_pubmethodMarkText(String, Int32)

Indicates whether or not the indicated text was found in the text document and creates unnamed bookmarks wherever matching text is found.

System_CAPS_pubmethodPrintOut()

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

System_CAPS_pubmethodReplacePattern(String, String, Int32, TextRanges)

Replaces matching text throughout an entire text document.

System_CAPS_pubmethodReplaceText(String, String, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

The TextDocument object is based on the Visual C++ version 6.0 Document object.

In Visual C++ version 6.0, the properties and methods of the TextDocument object were a superset of the Document object. In Visual Studio, however, Document has all the methods and properties that were part of TextDocument in Visual C++ version 6.0. In Visual Studio, TextDocument has only text-specific methods. The reason this does not break old code is that all methods that returned a TextDocument object in Visual C++ version 6.0 now return a Document object. So, old code that expects a TextDocument object actually uses a Document object.

Sub TextDocExample(ByVal dte As EnvDTE.DTE)
    Dim objTD As TextDocument = dte.ActiveDocument.Object
    MsgBox("Selection: " & objTD.Selection.Mode.ToString)
End Sub

Return to top
Show: