> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetSelection Method of the TextEditor Object

> SetSelection method of the TextEditor Object in ABBYY FineReader Engine Visual Components on Windows — This method allows you to set text selection on a page.

This method allows you to set text selection on a page.

## Syntax

### C++

```cpp theme={null}
HRESULT SetSelection(
  IEditorPosition* From,
  IEditorPosition* To
);
```

### C\#

```csharp theme={null}
void SetSelection(
  IEditorPosition From,
  IEditorPosition To
);
```

### Visual Basic .NET

```vb theme={null}
Sub SetSelection( _
  From As IEditorPosition, _
  To As IEditorPosition _
)
```

## Parameters

From

\[in] Refers to the [EditorPosition](/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) object that contains the cursor position of the beginning of the selection.

To

\[in] Refers to the [EditorPosition](/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) object that contains the cursor position of the end of the selection. The end of the selection must be on the same page on which the beginning is.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## See also

[TextEditor](/fine-reader/engine/visual-components-reference/texteditor)

[GetSelection](/fine-reader/engine/visual-components-reference/texteditor/getselection-method)
