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

# Batches Object (IBatches Interface)

This object is a collection of working [batches](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md#batch) that are part of the project you are working with and intended for processing documents. Besides standard collection methods and properties, it contains the [**FindById**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-findbyid.md) and [**FindByName**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-findbyname.md) methods that allows you to find the batch by its identifier and name. To access the batches of the certain project, use the **Batches** property of the corresponding [**Project**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project.md) object.

The **Batches** object is a so-called "[connectable object](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/connectableobjects.md)". The methods of the **Batches** object report information about the collection modification through special outgoing interfaces. These interfaces are [**ICollectionEvents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/icollectionevents.md) (for C++) and the dispinterface [**DICollectionEvents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/icollectionevents.md) (for Visual Basic). It should be noted that Visual Basic users should not care for details of implementing event interfaces, as this development platform provides easy means for handling them.

## Properties

| **Name** | **Type** | **Description** |
| - | - | - |
| [**Count**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/count.md) | [**Integer**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/propertiestypes.md), read-only | Stores the number of elements in the collection. |
| [**Element**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/element.md) | [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md), [read-only](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md#readonly-properties) | Provides access to a single element of the collection. |

## Methods

| **Name** | **Description** |
| - | - |
| [**AddNew**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-addnew.md) | Adds a batch with the specified name at the end of the collection of batches. |
| [**AddNewEx**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-addnewex.md) | Adds a batch of the specified batch type at the end of the collection of batches. |
| [**FindById**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-findbyid.md) | Provides access to a batch in the collection by the batch identifier. |
| [**FindByName**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches-findbyname.md) | Provides access to a batch in the collection by the batch name. |
| [**Item**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/item.md) | Provides access to a single element of the collection by its index in this collection. |
| [**DeleteById**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/deletebyid.md) | Removes an element with the specified identifier from the collection. You cannot delete the batch, if it is open (the [**IBatch::IsOpen**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md#isopen) property is TRUE). |
| [**DeleteAll**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/deleteall.md) | Removes all the elements from the collection. You cannot delete the batch, if it is open (the [**IBatch::IsOpen**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md#isopen) property is TRUE). |

## Related objects

![](https://mintcdn.com/abbyy/89WLEbAVqQ-ysQEU/images/flexi-capture/sdk/Batches.gif?s=be1868c815ccdcafb5b59e2e9b3a37ed)

## Samples

> [accordion] C++ (COM) code
>
> ```cpp theme={null}
> // Global ABBYY FlexiCapture SDK Engine object.
> FCEngine::IEnginePtr Engine;
> ...
> // Open the project
> FCEngine::IProjectPtr project = Engine->OpenProject("D:\\TestProject\\TestProject.fcproj");
> // Get project list of batches
> FCEngine::IBatchesPtr batches = project->GetBatches();
> // Add new batch
> FCEngine::IBatchPtr batch = batches->AddNew( L"TestBatch" );
> ...
> ```

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

## See also

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

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

[Working with Collections](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/collections.md)

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

[Working with Connectable Objects](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/connectableobjects.md)

[Working with Properties](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/properties.md)
