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

# SaveToMemory Method of the PDFAttachment Object

<Note>
  This method is implemented in FRE for Windows.
</Note>

This method saves the attached file into the global memory. The method returns an HGLOBAL handle of the memory area allocated for the object as the [Handle](/fine-reader/engine/api-reference/supplementary-objects-and-methods/handle) object. This object manages memory allocation and releases resources when they are no longer in use.

The method does not save the contents of the [PDFAttachment](/fine-reader/engine/api-reference/document-related-objects/pdfattachment) object, but only the attached file itself, so that you will be unable to retrieve, e.g., the attachment description or binding type from the saved data.

## Syntax

### C++

```cpp theme={null}
HRESULT SaveToMemory( IHandle** Result );
```

### C\#

```csharp theme={null}
IHandle SaveToMemory();
```

### Visual Basic .NET

```vb theme={null}
Function SaveToMemory() As IHandle
```

## Parameters

Result

\[out, retval] A pointer to IHandle\* pointer variable that receives interface pointer of the resulting [Handle](/fine-reader/engine/api-reference/supplementary-objects-and-methods/handle) object.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FineReader Engine functions](/fine-reader/engine/api-reference/return-codes).

## Remarks

This method does not work if the Engine object is created using the [OutprocLoader](/fine-reader/engine/api-reference/engine-loaders/outprocloader) object.

## See also

[PDFAttachment](/fine-reader/engine/api-reference/document-related-objects/pdfattachment)
