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

# ApplyDocumentDefinitions Method of the Project Object

This method applies Document Definitions of the project (specified by the [**IProject::DocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md#documentdefinitions) property) to the documents from the specified batches. Document Definitions matching is a process of selecting Document Definition that can be applied to a particular page and matching fields of the Document Definition against an image. The process must be performed before recognition.

Use this method to match the Document Definitions to project documents explicitly. With the help of this method you can select the mode of Document Definitions matching. Also you can use the [**Recognize**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project-recognize.md) method of the [**Project**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md) object with correct recognition mode, in this case Document Definitions will be matched automatically before recognition.

## Syntax

```vb Visual Basic .NET theme={null}
Sub ApplyDocumentDefinitions( _
  BatchIds As IntsCollection, _
  Incremental As Boolean _
)
```

```cpp C++ theme={null}
HRESULT ApplyDocumentDefinitions(
  IIntsCollection*  BatchIds,
  VARIANT_BOOL      Incremental
);
```

## Parameters

**BatchIds**

\[in] This parameter refers to the [**IntsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/intscollection.md) object that contains a set of identifiers of the batches. Document Definitions should be matched to the documents of these batches. This parameter is optional and may be set to 0, in which case Document Definitions are matched to all the documents of the project.

**Incremental**

\[in] This parameter specifies the mode of Document Definitions matching. It can be set to TRUE if you want to match Document Definitions to the documents which do not have applied Document Definitions and the documents with changed Document Definitions. When it is set to FALSE, ABBYY FlexiCapture SDK will match document definitions to all the documents of the project. This parameter is optional. The default value of the parameter is TRUE.

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

## Remarks

* During this method call documents in the project can be reorganized, e.g. documents can be merged or split depending on the Document Definitions applied to them, also some document identifiers can be changed.
* To match Document Definitions to only several documents from the batch, use the [**ApplyDocumentDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch-applydocumentdefinitions.md) method of the [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md) object.

## See also

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

[**IProject::Recognize**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project-recognize.md)
