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

# Using a Document Object within a Project

The **Document** object provides a set of methods and properties for working with a document. The object usually contains a lot of information about the processed document (image of the document, recognized text, etc.) and therefore requires considerable resources for operation. To save resources and provide parallel access to the processed document, ABBYY FlexiCapture SDK can provide the document in 3 different states: closed, open for reading, and open for reading and writing. The state of the document is defined by the [**IDocument::LockType**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document.md#locktype) property. For the closed document not all the properties and methods are available. If you want to view or to change the properties and structure of the document, the document should be open for reading or for reading and writing, respectively.

The topics below describe the ways to change the state of the document:

> [accordion] If you are going to view the document and do not want to change it...
>
> To view the contents of a closed [**Document**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document.md) object, call the [**Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md) method with the FALSE value as the parameter. After the successful method execution the object is open for reading.
>
> If you do not need to view the properties of the document any more, you can close it using the [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) method. In this case the document is closed and the resources are freed.

> [accordion] If you are going to edit the document...
>
> Before editing the document which is currently closed, you should call the [**Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md) method with the TRUE value as the parameter.
>
> After the successful method call the closed document will be open for reading and writing.

> [accordion] If you want to save the results of the document editing...
>
> * Before saving, verify the changes made to the document using the [**CheckRules**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-checkrules.md) method. You will be able to save the results even if some rules show errors.
> * You can save the changes made to the document and close it. To do this, call the [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) method with the TRUE parameter.
> * You can save the changes made to the document and proceed with editing. To do this, call the [**Save**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-save.md) method.
> * You can save the changes made to the document and keep it as open for reading. To do this, you can reopen the document by calling the [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) method with the TRUE parameter and then call the [**Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md) method with the FALSE value as the parameter.

> [accordion] If you do not want to save the results of the document editing...
>
> * If you want to close the document and do not want to save changes made to it, call the [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) method with the FALSE parameter.
> * If you want to keep the document as open for reading and do not want to save changes made to it, you can reopen the document by calling the [**Close**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-close.md) method with the FALSE parameter and then call the [**Open**](https://docs.abbyy.com/flexi-capture/sdk/api-reference/document-open.md) method with the FALSE value as the parameter.

## See also

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

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

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

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

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