Export (0) Print
Expand All
Expand Minimize

TextDocument Property (General Extensibility)

Visual Studio .NET 2003

Returns the TextDocument Object for the window or pane.

[Visual Basic .NET]
Public ReadOnly Property TextDocument() As TextDocument
[Visual Basic 6]
Property Get TextDocument() As TextDocument
HRESULT __stdcall get_TextDocument(
   /* [out, retval] */ TextDocument** retVal
TextDocument TextDocument {get;}
[JScript .NET]
public function get TextDocument() : TextDocument

Return Value

Returns a TextDocument object.


Attempting to modify the document through this property or an EditPoint Object fails because the entire document's region is read-only. You can only modify the document through members on CommandWindow Object


Sub TextDocumentExample()
   ' This generates a text document listing all available command names.
   Dim Cmd As Command
   Dim Doc As Document
   Dim TxtDoc As TextDocument
   DTE.ItemOperations.NewFile ("General\Text File")
   Doc = ActiveDocument
   TxtDoc = Doc.Object("TextDocument")
   For Each Cmd In DTE.Commands
   If (Cmd.Name <> "") Then
     TxtDoc.Selection.Text = Cmd.Name & vbLF
   End If
End Sub

See Also

Applies To: CommandWindow Object | OutputWindowPane Object

© 2014 Microsoft