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

# ExportToMemory Method of the Batch Object

This method saves results of the specified documents processing into memory, presented as a virtual file system. You can save the results from all the documents of the batch or specify particular documents to export results from. Use the [**ExportParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/exportparams.md) object to set the export settings. However, the values of the [**RootPath**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fileexportparams.md#rootpath) property of the [**FileExportParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fileexportparams.md) object and the [**Path**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageexportparams.md#path) property of the [**ImageExportParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageexportparams.md) object are always ignored. Instead, the Export directory and Images directory relative to the root of the virtual file system will be used as the folders for output files. You can have other subfolders inside the Export and Images directories, which are defined by the [**FileNamePattern**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/fileexportparams.md#filenamepattern) property of the **FileExportParams** object and the [**Prefix**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imageexportparams.md#prefix) property of the **ImageExportParams** object.

Note that you can configure multiple export profiles (a set of settings that determines what is done with processed data) with the help of the [**IExportProfiles::AddNew**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/exportprofiles-addnew.md) method, in which case all appropriate export profiles for export to memory are used in turn.

> [!NOTE]
>
> Only export profiles with the **EDT\_File** value (export to file) of the [**DestinationType**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/exportparams.md#destinationtype) property is supported for exporting to memory. Export profiles with another destination value are ignored.

## Syntax

```vb Visual Basic .NET theme={null}
Sub ExportToMemory( _
  DocIds As IntsCollection, _
  Params As ExportParams _
) As VirtualFileSystemNode
```

```cpp C++ theme={null}
HRESULT ExportToMemory(
  IIntsCollection* DocIds,
  IExportParams*   Params,
  IVirtualFileSystemNode** Result
);
```

## Parameters

**DocIds**

\[in] This parameter refers to the [**IntsCollection**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/intscollection.md) object that contains a set of identifiers of the documents to export results from. This parameter may be 0, in which case export is performed for all the documents of the batch.

**Params**

\[in] This parameter refers to the [**ExportParams**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/exportparams.md) object that contains parameters of export. This parameter may be 0, in which case for each document the export parameters of the corresponding Document Definition are used.

> [!NOTE]
>
> If there is no corresponding Document Definition, the export parameters of the [IBatchTypeParams::ExportParamsForUnknownDocuments](https://docs.abbyy.com/flexi-capture/sdk/api-reference/batchtypeparams.md#exportparamsforunknowndocuments) property are used. If there is no batch type, the export parameters of the [IProjectProperties::ExportParamsForUnknownDocuments](https://docs.abbyy.com/flexi-capture/sdk/api-reference/projectproperties.md#exportparamsforunknowndocuments) property are used.

**Result**

\[out, retval] A pointer to the [**IVirtualFileSystemNode**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/virtualfilesystemnode.md)**\*** object that receives the results of the exported 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).

## Samples

See the following code sample: [ExportToMemory](https://docs.abbyy.com/flexi-capture/sdk/api-reference/project-exporttomemory.md#samples)

## See also

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