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

# LoadImageDocFromFile Method of the Engine Object

This method restores the contents of the [**ImageDocument**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imagedocument.md) object from the file.

## Syntax

```vb Visual Basic .NET theme={null}
Function LoadImageDocFromFile(fileName As String) As ImageDocument
```

```cpp C++ theme={null}
HRESULT LoadImageDocFromFile(
  BSTR             fileName,
  IImageDocument** result
);
```

## Parameters

**fileName**

\[in] This parameter specifies the full path to the file with the contents of the **ImageDocument** object.

**result**

\[out, retval] A pointer to **IImageDocument\*** pointer variable that receives the interface pointer of the resulting [**ImageDocument**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imagedocument.md) object. Must not be NULL.

## Return values

This method has no specific return values. It returns [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## See also

[**Engine**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/engine.md) [**ImageDocument::SaveToFile**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/imagedocument-savetofile.md)
