Export (0) Print
Expand All
ID
Top
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
[C++]
HRESULT __stdcall get_TextDocument(
   /* [out, retval] */ TextDocument** retVal
);
[C#]
TextDocument TextDocument {get;}
[JScript .NET]
public function get TextDocument() : TextDocument

Return Value

Returns a TextDocument object.

Remarks

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

Example

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
     TxtDoc.Selection.Collapse
   End If
   Next
End Sub

See Also

Applies To: CommandWindow Object | OutputWindowPane Object

Show:
© 2014 Microsoft