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

# Documents オブジェクトの FindById メソッド

このメソッドを使用すると、識別子を指定してドキュメントを検索できます。このメソッドは、閉じられた状態のドキュメント (**IDocument::LockType** = [LT\_None](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/locktypeenum.md)) を返します。

## 構文

```vb Visual Basic .NET theme={null}
Function FindById(Id As Integer) As Document
```

```cpp C++ theme={null}
HRESULT FindById(
  int         Id,
  IDocument** Result
);
```

## パラメーター

**Id**

\[in] この変数には、検索対象のドキュメントの識別子を指定します。

**Result**

\[out, retval] ドキュメントのインターフェースポインターを受け取る [**IDocument**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document.md)\*\*\*\*\* 変数へのポインター。指定された識別子を持つドキュメントが見つからない場合は NULL を返します。

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## サンプル

このオブジェクトは、次のコード サンプルで使用されています：[分類](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#classification)

## 関連項目

[**Documents**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/documents.md)
