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

# ITaskWindow

> ITaskWindow object reference for FlexiCapture station scripts: open, edit, and close documents, query document state, and close or reject tasks.

## What it does

Represents the task window.

## Methods

<table width="100%"><thead><tr><th><p><strong>Definition</strong></p></th><th><p><strong>Description</strong></p></th></tr></thead><tbody><tr><td><p>CloseDocument( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> )</p></td><td><p>Closes the document for editing from script.</p><p>When calling this method, the <a href="/flexi-capture/appendix/scripts-shell/tdocumentstate">document state</a> is changed.</p></td></tr><tr><td><p>CloseEditorWindow()</p></td><td><p>Closes the document editor.</p><p><strong>Important! </strong> When closing the document editor, all unsaved changes will be lost.</p><p>When calling this method, the <a href="/flexi-capture/appendix/scripts-shell/tdocumentstate">document state</a> is changed.</p></td></tr><tr><td><p>CloseTask( bool )</p></td><td><p>Closes the task with a warning that the process will be canceled (if the argument is set to <strong>true</strong>) or without a warning (if the argument is set to <strong>false</strong>).</p></td></tr><tr><td><p>DocumentState( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> ) : <a href="/flexi-capture/appendix/scripts-shell/tdocumentstate">TDocumentState</a></p></td><td><p>Retrieves the document state in the task window.</p><p><strong>Note: </strong> The method cannot be invoked from a secondary thread.</p></td></tr><tr><td><p>EditDocument( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a>, page : <a href="/flexi-capture/appendix/scripts/ipage">IPage</a> ) : <a href="/flexi-capture/appendix/scripts-shell/idocumenteditor">IDocumentEditor</a></p></td><td><p>Opens the document in the document editor for editing.</p><p><strong>Note: </strong> If the document is opened successfully, the object of the <a href="/flexi-capture/appendix/scripts-shell/idocumenteditor">IDocumentEditor</a> type is returned. Otherwise <strong>null</strong> is returned.</p><p>When calling this method, the <a href="/flexi-capture/appendix/scripts-shell/tdocumentstate">document state</a> is changed.</p></td></tr><tr><td><p>OpenDocument( document : <a href="/flexi-capture/appendix/scripts/idocument">IDocument</a> )</p></td><td><p>Opens the document for editing from script. The method can be called even when the document is opened in the document editor with read-only permissions.</p><p>When calling this method, the <a href="/flexi-capture/appendix/scripts-shell/tdocumentstate">document state</a> is changed.</p></td></tr><tr><td><p>RejectTask( bool )</p></td><td><p>Rejects the task with a warning that the process will be canceled (if the argument is set to <strong>true</strong>) or without a warning (if the argument is set to <strong>false</strong>).</p></td></tr></tbody></table>

## Properties

| **Name**        | **Type**                                                                   | **Access** | **Description**          |
| --------------- | -------------------------------------------------------------------------- | ---------- | ------------------------ |
| Batch           | [IBatch](/flexi-capture/appendix/scripts/ibatch)                           | Read-only  | The batch                |
| DocumentsWindow | [IDocumentsWindow](/flexi-capture/appendix/scripts-shell/idocumentswindow) | Read-only  | The documents window     |
| EditorWindow    | [IDocumentEditor](/flexi-capture/appendix/scripts-shell/idocumenteditor)   | Read-only  | The document editor      |
| Handle          | int                                                                        | Read-only  | The handle of the window |
| MainWindow      | [IMainWindow](/flexi-capture/appendix/scripts-shell/imainwindow)           | Read-only  | The main window          |
| Mode            | [TTaskWindowMode](/flexi-capture/appendix/scripts-shell/ttaskwindowmode)   | Read/write | The view mode            |
