Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TextDocument Object

Visual Studio .NET 2003

Represents a text file open in the editor, such as the Visual Studio Code editor.

DTE

   Documents

      Document

         TextDocument

[Visual Basic .NET]
Public Interface TextDocument
    Inherits IDispatch
[Visual Basic 6]
Class TextDocument
[C++]
interface TextDocument : IDispatch
[C#]
public interface TextDocument : IDispatch
[JScript .NET]
public interface TextDocument extends IDispatch

Remarks

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 .NET, however, Document has all the methods and properties that were part of TextDocument in Visual C++ version 6.0. In Visual Studio .NET, TextDocument has only text-specific methods. The reason this does not break old code is that all methods that in Visual C++ version 6.0 returned a TextDocument object now return a Document object. So, old code that expects a TextDocument object will actually be using a Document object without knowing it.

Requirements

Namespace: EnvDTE

File: dte.olb

Example

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

See Also

Properties, Methods and Events | TextWindow Object | HTMLWindow Object

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.