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

# ICollectionEvents Interface

This is a callback interface that is used for reporting events from the following collection objects to the listeners:

* [**AssemblingErrors**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/assemblingerrors.md)
* [**Batches**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batches.md)
* [**BatchTypes**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batchtypes.md)
* [**Blocks**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/blocks.md)
* [**Documents**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents.md)
* [**FieldInstances**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fieldinstances.md)
* [**Fields**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fields.md)
* [**Pages**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/pages.md)
* [**RuleErrors**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/ruleerrors.md)
* [**TableColumns**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/tablecolumns.md)

This interface is implemented on the client side. See the detailed implementation advice for your development tool in [Working with Connectable Objects](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/connectableobjects.md). Below you can find a short summary.

In C++ you need to implement the **ICollectionEvents** interface, obtain a connection point, and "advise" object implementing the interface to the necessary connectable object. As the interface is derived from the **IUnknown** interface, the client object should also implement the **IUnknown** methods.

Visual Basic users that want to receive notifications from one of these objects should declare the event source object of the **CollectionEventsSource** type *WithEvents*, initialize it with the required collection object and implement the Sub's similar to the following:

```vb theme={null}
Private Sub eventsSource_OnCollectionChanged(ByVal Reloaded As Boolean, _
                                             ByVal AddedItems As IntsCollection, _
                                             ByVal DeletedItems As IntsCollection, _
                                             ByVal ModifiedItems As IntsCollection)
...
End Sub
```

An object receiving notifications through this interface methods may do the following inside the methods implementation:

* Process any Windows messages, which is useful in applications having User Interface, to avoid an effect that the application "is not responding" during long recognition operations.
* Report information about adding, deleting and modifying of collection elements to the user.

## Methods

| **Name** | **Description** |
| - | - |
| [**OnCollectionChanged**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/icollectionevents-oncollectionchanged.md) | Delivers to the client information about adding, deleting and modifying of collection elements. |

## See also

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

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