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

# FindById Method of the Documents Object

This method allows you to find a document by its identifier. The method returns closed document (**IDocument::LockType** = [LT\_None](https://docs.abbyy.com/flexi-capture/sdk/api-reference/locktypeenum.md)).

## Syntax

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

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

## Parameters

**Id**

\[in] This variable contains the identifier of the document to be found.

**Result**

\[out, retval] A pointer to the [**IDocument**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document.md)**\*** variable that receives the interface pointer for the document. Returns NULL, if the document with the specified identifier is not found.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## Samples

This object is used in the following code samples: [Classification](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/samples.md#classification).

## See also

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