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

# DeleteById Method

This method is specific to [collection objects](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/collections.md). It removes an element with the specified identifier from the collection. An open batch cannot be deleted.

## Syntax

```vb Visual Basic .NET theme={null}
Sub DeleteById(Id As Integer)
```

```cpp C++ theme={null}
HRESULT DeleteById(
  int Id
);
```

## Parameters

**Id**

\[in] This variable contains the identifier of the collection element. It should be received as the value of the **Id** property of the corresponding collection element.

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

The following collection objects provide this method:

* [**Batches**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches.md) – 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)
* [**BlockDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/blockdefinitions.md)
* [**Documents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents.md)
* [**PageDefinitions**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pagedefinitions.md)
* [**Pages**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pages.md)

## See also

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

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