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

# InsertAt Method of the Collection Objects

This method inserts a new element at the specified position in the collection.

## Syntax

```vb Visual Basic .NET theme={null}
Sub InsertAt( _
  Value As <CollectionType>, _
  Index As Integer _
)
```

```cpp C++ theme={null}
HRESULT InsertAt(
  <CollectionType> Value,
  int              Index
);
```

## Parameters

**Value**

\[in] This parameter contains the newly inserted element. Its type depends on the type of collection and is described in the following table:

| **Collection type** | **Element type (Visual basic/C++)** |
| - | - |
| [**StringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md) | String/BSTR |
| [**IntsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/intscollection.md) | Integer/int |

**Index**

\[in] This parameter specifies the index of the newly inserted element. If the element is inserted in place of the existing element, the elements of the collection are shifted to the right. The element may also be inserted at the end of collection, in which case the value of this parameter must be equal to the value of the [**Count**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/count.md) property.

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

## See also

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