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

# Close Method of the Document Object

This method closes a document. It allows you to free some resources and save the changes made to the document.

Note that if you save changes on close, it's best to verify the changed fields using the [**CheckRules**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-checkrules.md) method before closing the document. You will be able to save the changes even if the rules show some errors.

## Syntax

```vb Visual Basic .NET theme={null}
Sub Close(SaveChanges As Boolean)
```

```cpp C++ theme={null}
HRESULT Close(
  VARIANT_BOOL SaveChanges
);
```

## Parameters

**SaveChanges**

\[in] This variable specifies whether the changes made to the document should be saved. If the value of this parameter is FALSE, the changes are not saved. This parameter is optional. The default value of the parameter is TRUE.

## Return values

This method has no specific return values. It returns the [standard return values of ABBYY FlexiCapture SDK functions](https://docs.abbyy.com/flexi-capture/sdk/api-reference/errorcodes.md).

## See also

[**Document**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document.md)

[**IDocument::Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md)

[Using a Document Object within a Project](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/document-using.md)

[See sample](https://docs.abbyy.com/flexi-capture/sdk/guided-tour/samples.md): FlexiCapture SDK Code Snippets, FlexiCapture Project Viewer
