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

# Documents オブジェクトの AddNewFromPage メソッド

このメソッドは、既存のドキュメントから指定したページを抽出し、バッチ内の指定した位置に新しいドキュメントとして作成します。

> [!NOTE]
>
> 対象のドキュメントが 1 ページしかない場合、そのドキュメントは複製されず、バッチ内のドキュメント数も変わりません。

## 構文

```vb Visual Basic .NET theme={null}
Function AddNewFromPage( _
  page As Page, _
  pos As Integer
) As Document
```

```cpp C++ theme={null}
HRESULT AddNewFromPage(
  IPage*      page,
  int         pos,
  IDocument** result
);
```

## パラメーター

**page**

\[in] 新しいドキュメントの作成元となるページを含む [**Page**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/page.md) オブジェクトを参照します。

**pos**

\[in] 現在のバッチ内での新しいドキュメントのインデックスを指定します。既存のドキュメントの位置に挿入した場合、バッチ内のドキュメントは右にシフトされます。ドキュメントはバッチの末尾に挿入することもできます。その場合、このパラメーターの値は [**IDocuments::Count**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/count.md) プロパティの値と等しくする必要があります。

**result**

\[out, retval] 新しいドキュメントのインターフェースポインターを受け取る [**IDocument**](https://docs.abbyy.com/ja/flexi-capture/sdk/api-reference/document.md)\*\*\*\*\* 変数へのポインター。

## 戻り値

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

## 関連項目

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