Description
The CodeEditor.SelectedText
property lets you obtain the text that is selected in the currently active Code Editor instance in TestComplete, or the word (identifier, routine name, keyword, number, etc.) on which the insertion point is positioned.
If the SelectedText
property holds the selected text, you can determine the positions of its first and last characters within the Code Editor’s entire text using the SelectionStart
and SelectionEnd
properties.
Declaration
Applies To
The property is applied to the following object:
Property Value
The text selected in the active Code Editor instance, or, if no text is selected, the word around the insertion point. If there is no word at the insertion point, the SelectedText
property returns an empty string.
Remarks
If the Code Editor is not active in the TestComplete Workspace panel, the SelectedText
property raises an error. To check if there is an active Code Editor, use the IsEditorActive
property.
See Also
SelectionEnd Property
SelectionStart Property
Text Property
Working With the Code Editor