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

# MoveById Method of the Documents Object

This method allows you to move the document with the specified identifier to the selected position in the collection.

## Syntax

```vb Visual Basic .NET theme={null}
Sub MoveById( _
  Id As Integer, _
  NewPos As Integer _
)
```

```cpp C++ theme={null}
HRESULT MoveById(
  int Id,
  int NewPos
);
```

## Parameters

**Id**

\[in] This variable contains the identifier of the document which is to be moved. The identifier should be received as the value of the [**IDocument::Id**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document.md) property.

**NewPos**

\[in] The document will be placed in the position **before** the document with this index. Must be in a range from 1 to the value of the [**IDocuments::Count**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/documents.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

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