> ## 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 オブジェクトの GetSelection メソッド

> Windows 上の ABBYY FineReader Engine Visual Components における TextEditor オブジェクトの GetSelection メソッド — このメソッドは、選択範囲の開始位置と終了位置のカーソル位置を返します。

このメソッドは、選択範囲の開始カーソル位置と終了カーソル位置を返します。選択範囲が未定義の場合、出力 [EditorPosition](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) オブジェクトのすべてのプロパティは -1 になります。

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

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

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

### C\#

```csharp theme={null}
HRESULT GetSelection(
  out IEditorPosition From,
  out IEditorPosition To
);
```

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

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

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

開始位置

\[out] 選択範囲の先頭のカーソル位置を、[EditorPosition](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/editorposition) オブジェクトとして格納します。

終了位置

\[out] 選択範囲の末尾のカーソル位置を、[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)

[SetSelection](/ja/fine-reader/engine/visual-components-reference/texteditor/setselection-method)
