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

# エンジン オブジェクトの OpenProject メソッド

このメソッドは、FlexiCapture プロジェクトを開きます。プロジェクトフォルダーには、プロジェクトファイル (.fcproj ファイル) と、ドキュメント定義を格納したフォルダーが含まれている必要があります。

プロジェクトが以前のバージョンの ABBYY FlexiCapture SDK または ABBYY FlexiCapture で作成されている場合は、まずプロジェクトを更新する必要があります。更新するには、[**エンジン**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine.md) オブジェクトの [**UpdateProject**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine-updateproject.md) メソッドを呼び出します。ただし、これらの製品の新しいバージョンで作成されたプロジェクトは使用できません。

> [!WARNING]
>
> * プロジェクトのオブジェクトへの参照を使用している間は、[**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project.md) オブジェクトへの参照を保持する必要があります。**Project** オブジェクトへの参照を解放した後もそのサブオブジェクトを使用していると、エラーが発生する可能性があります。
> * 開いているプロジェクトは削除できません。

## 構文

```vb Visual Basic .NET theme={null}
Function OpenProject(Path As String) As Project
```

```cpp C++ theme={null}
HRESULT OpenProject(
  BSTR       Path,
  IProject** Result
);
```

## パラメーター

**Path**

\[in] この変数には、プロジェクトファイル (.fcproj ファイル) のフルパスが格納されます。例：「D:\TestProject\TestProject.fcproj」

**Result**

\[out, retval] 生成された [**Project**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/project.md) オブジェクトへのインターフェースポインターを受け取る **IProject**\* ポインター変数へのポインター。NULL にすることはできません。

## 戻り値

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

## サンプル

> [accordion] C++ (COM) コード
>
> ```cpp theme={null}
> // ABBYY FlexiCapture SDK のグローバル Engine オブジェクト
> FCEngine::IEnginePtr Engine;
> ...
> // プロジェクトを開く
> FCEngine::IProjectPtr project = Engine->OpenProject("D:\\TestProject\\TestProject.fcproj");
> ...
> ```

このメソッドは、次のコード サンプルで使用されています: [Hello](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#hello)、[FieldsExtractionTraining](https://docs.abbyy.com/ja/flexi-capture/sdk/guided-tour/samples.md#fieldsextractiontraining)

## 関連項目

[**エンジン**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/engine.md)

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