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

# AddImages Method of the Batch Object

This method adds specified images to the batch. The method creates documents in the batch for added images.

## Syntax

```vb Visual Basic .NET theme={null}
Sub AddImages( _
  Files As StringsCollection, _
  DocID As Integer, _
  LoadingParams As ImageLoadingParams, _
  GroupingParams As ImageGroupingParams, _
  PasswordProtectedPdf As StringsCollection, _
  DocIds As IntsCollection _
)
```

```cpp C++ theme={null}
HRESULT AddImages(
  IStringsCollection*   Files,
  int                   DocID,
  IImageLoadingParams*  LoadingParams,
  IImageGroupingParams* GroupingParams,
  IStringsCollection**  PasswordProtectedPdf,
  IIntsCollection**     DocIds
);
```

## Parameters

**Files**

\[in] This parameter refers to the [**StringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md) object which contains a collection of paths to the files to be added.

**DocID**

\[in] This parameter specifies the identifier of the document in the batch. The created documents will be inserted into the collection of batch documents after the document with the specified identifier. This parameter may be set to -1, in which case the documents will be added at the end of the batch.

**LoadingParams**

\[in] This variable refers to the [**ImageLoadingParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageloadingparams.md) object that stores parameters of image preparation during adding to the batch. This parameter may be 0. In this case the images are added using the parameters set in the project properties (the [**IProjectProperties::ImageLoadingParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/projectproperties.md#imageloadingparams) property).

**GroupingParams**

\[in] This variable refers to the [**ImageGroupingParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imagegroupingparams.md) object that stores parameters that determine the principles of adding images to documents. This parameter may be 0. In this case the images are added using the parameters set in project properties in ABBYY FlexiCapture.

**PasswordProtectedPdf**

\[in, out] A pointer to the [**IStringsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/stringscollection.md)**\*** variable that receives the interface pointer for the collection of paths to the files which were not added, because they are password-protected and cannot be opened (possible only for input files in PDF format).

**DocIds**

\[in, out] A pointer to the [**IIntsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/intscollection.md)**\*** variable that receives the interface pointer for the list of identifiers of the added documents.

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

* To add one image to the batch, you can use the [**AddImage**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch-addimage.md) method of the [**Batch**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batch.md) object.
* You may also use this method to open digital documents of [supported formats](https://docs.abbyy.com/flexi-capture/sdk/specifications/digitalinputformats.md).

## 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");
> // Add new batch
> FCEngine::IBatchPtr batch = project->Batches->AddNew( L"TestBatch" );
> // Open the batch
> batch->Open();
> // Add images to the batch
> FCEngine::IStringsCollectionPtr fileList = Engine->CreateStringsCollection();
> fileList->Add( L"D:\\SampleImages\\0001.tif" );
> ...
> FCEngine::IStringsCollectionPtr passwordProtected = Engine->CreateStringsCollection();
> FCEngine::IIntsCollectionPtr docIdList = Engine->CreateStringsCollection();
> batch->AddImages( fileList, -1, 0, 0, passwordProtected, docIdList );
> ...
> ```

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

## See also

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