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

# ITextValidatorEvents インターフェイスの OnValidationEvent メソッド

> Windows 上の ABBYY FineReader Engine Visual Components における ITextValidatorEvents インターフェイスの OnValidationEvent メソッド — このメソッドはクライアント側で実装されます。

このメソッドはクライアント側で実装されます。[Text Validator](/ja/fine-reader/engine/visual-components-reference/textvalidator) がスペルチェック中にエラーを検出すると、ABBYY FineReader Engine によって呼び出されます。このメソッドでは、エラーに対して実行する操作 (無視、置換、または認識が不確かな単語を辞書に追加) をクライアント側で選択できます。

このメソッドは、Text Validator にエラーが表示される前に呼び出されます。このメソッドで [TVC\_None](/ja/fine-reader/engine/visual-components-reference/enumerations/textvalidatorcommandenum#tvc_none) 以外の動作を選択した場合、そのエラーは Text Validator に表示されません。

検出されたエラーに関する情報は、[ITextValidator::ValidatorError](/ja/fine-reader/engine/visual-components-reference/textvalidator#validatorerror) プロパティを使用して取得できます。

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

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

```cpp theme={null}
HRESULT OnValidationEvent(
  TextValidatorCommandEnum* Reaction,
  ISpellWord**              Replacement
);
```

### C\#

```csharp theme={null}
void OnValidationEvent(
  ref TextValidatorCommandEnum Reaction,
  ref ISpellWord                Replacement
);
```

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

```vb theme={null}
Sub OnValidationEvent( _
  ByRef Reaction As TextValidatorCommandEnum, _
  ByRef Replacement As ISpellWord _
)
```

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

Reaction

\[out] この [TextValidatorCommandEnum](/ja/fine-reader/engine/visual-components-reference/enumerations/textvalidatorcommandenum) 型の変数は、単語に適用するコマンドを指定します。このメソッドで Reaction に [TVC\_None](/ja/fine-reader/engine/visual-components-reference/enumerations/textvalidatorcommandenum#tvc_none) 以外を指定した場合、エラーは Text Validator に表示されません。

Replacement

\[out] 置換後の単語を [SpellWord](/ja/fine-reader/engine/visual-components-reference/supplementary-objects/spellword) オブジェクトとして表します。この Parameter は、Reaction Parameter が TVC\_Replace または TVC\_ReplaceAll の場合に使用されます。

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

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

<div id="remarks">
  ## 注記
</div>

このメソッドのクライアント実装では、メソッド内でスローされるすべての例外を必ずキャッチして処理し、どの例外もメソッドの外に伝播しないようにする必要があります。例外がメソッドの外に伝播すると、予期しない結果 (プログラムの終了など) を招くおそれがあります。

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

[ITextValidatorEvents](/ja/fine-reader/engine/visual-components-reference/itextvalidatorevents)
