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

# PDFAttachments オブジェクトの AddFromMemory メソッド

> ABBYY FineReader Engine API の PDFAttachments オブジェクトの AddFromMemory メソッド — グローバル メモリから PDF 添付ファイルのコレクションにファイルを追加します（Windows のみ）。

<Note>
  このメソッドは、Windows 版 FRE で実装されています。
</Note>

このメソッドは、ユーザーがあらかじめグローバル メモリに読み込んでおいたファイルを、PDF 添付ファイルのコレクションに追加します。

<div id="syntax">
  ## 構文
</div>

<div id="c">
  ### C++
</div>

```cpp theme={null}
HRESULT AddFromMemory(
  __int64          HGlobal,
  BSTR             FileName,
  BSTR             Description,
  IPDFAttachment** Result
);
```

### C\#

```csharp theme={null}
IPDFAttachment AddFromMemory(
  Int64  HGlobal,
  string FileName,
  string Description
);
```

<div id="visual-basic-net">
  ### Visual Basic .NET
</div>

```vb theme={null}
Function AddFromMemory( _
  HGlobal As Int64, _
  FileName As String, _
  [Description As String = "0"] _
) As IPDFAttachment
```

<div id="parameters">
  ## パラメーター
</div>

HGlobal

\[in] 添付ファイルを含むメモリ ブロックの HGLOBAL ハンドルを指定します。ハンドルは [\_\_int64](/ja/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties) として渡されます。このハンドルは有効である必要があります。

FileName

\[in] 添付ファイルの名前を指定します。名前にはファイル拡張子が含まれている必要があります。

Description

\[in] 添付ファイルのユーザー定義の説明を格納します。このパラメーターは省略可能で、空の文字列でもかまいません。

Result

\[out, retval] 追加された添付ファイルを表すオブジェクトのインターフェイス ポインターを受け取る、[IPDFAttachment](/ja/fine-reader/engine/api-reference/document-related-objects/pdfattachment)\* ポインター変数へのポインター。

<div id="return-values">
  ## 戻り値
</div>

このメソッド固有の戻り値はありません。[ABBYY FineReader Engine 関数の標準的な戻り値](/ja/fine-reader/engine/api-reference/return-codes)が返されます。

<div id="remarks">
  ## 注記
</div>

Engine オブジェクトが [OutprocLoader](/ja/fine-reader/engine/api-reference/engine-loaders/outprocloader) オブジェクトを使用して作成されている場合、このメソッドは使用できません。

<div id="see-also">
  ## 関連項目
</div>

[PDFAttachments](/ja/fine-reader/engine/api-reference/document-related-objects/pdfattachments)
