> ## 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.

# TextEditor オブジェクトの SetSelection メソッド

> Windows の ABBYY FineReader Engine Visual Components における TextEditor オブジェクトの SetSelection メソッド — このメソッドを使用すると、ページ上のテキストの選択範囲を設定できます。

このメソッドを使用すると、ページ上のテキストの選択範囲を設定できます。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

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

### C\#

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

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

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

<div id="parameters">
  ## パラメーター
</div>

From

\[in] 選択範囲の開始位置におけるカーソル位置を含む [EditorPosition](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) オブジェクトを指定します。

To

\[in] 選択範囲の終了位置におけるカーソル位置を含む [EditorPosition](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) オブジェクトを指定します。選択範囲の終了位置は、開始位置と同じページ上になければなりません。

<div id="return-values">
  ## 戻り値
</div>

このメソッド固有の戻り値はありません。代わりに、[ABBYY FineReader Engine 関数の標準戻り値](/ja/fine-reader/engine/api-reference/return-codes)が返されます。

<div id="see-also">
  ## 関連項目
</div>

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

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