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

# ImageDocument オブジェクトの SaveToFile メソッド

このメソッドは、[**ImageDocument**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/imagedocument.md) オブジェクトの内容をファイルに保存します。保存されるファイルの形式は、外部プログラムでは表示できません。このメソッドで保存した **ImageDocument** オブジェクトは、[**IEngine::LoadImageDocFromFile**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine-loadimagedocfromfile.md) メソッドでのみ開くことができます。

## 構文

```vb Visual Basic .NET theme={null}
Sub SaveToFile(fileName As String)
```

```cpp C++ theme={null}
HRESULT SaveToFile(
   BSTR fileName
);
```

## パラメーター

**fileName**

\[in] このパラメーターには、ファイルのフルパスを指定します。例: "C:\MyPic.imageDoc"。このファイルが既に存在する場合は、確認なしで上書きされます。

## 戻り値

このメソッドには固有の戻り値はありません。[ABBYY FlexiCapture SDK 関数の標準の戻り値](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/errorcodes.md)を返します。

## 備考

このメソッドは **ImageDocument** オブジェクトの内容を表示に適さない形式で保存するため、画像の保存には適していません。このメソッドは、オブジェクトの内容をディスク上のフォルダーに保存する [**IImageDocument::SaveTo**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/imagedocument-saveto.md) メソッドを使用できない場合に使用するためのものです。

画像を表示に適した形式で保存するには、[**IImage::WriteToFile**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/image-writetofile.md) メソッドを使用してください。

## 関連項目

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

[**IEngine::LoadImageDocFromFile**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine-loadimagedocfromfile.md)
