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

# IMainMenu

> IMainMenu represents the main window menu of a FlexiCapture station as a collection of IMenuItem objects, with a Reset method to restore the default menu.

## What it does

A collection of [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem) interfaces. Represents the main window menu.

For all items of this menu, the [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid) property returns **CI\_SubMenu**.

## Methods

| **Definition** | **Description**                               |
| -------------- | --------------------------------------------- |
| Reset()        | Resets the menu (restores the original view). |

<Warning>
  After applying the **Reset** method the current object of **IMainMenu** type is destructed and a new object is generated. As a result, all references to the current object become invalid and attempts to use it will generate an exception. You must either define a new object or initialize the existing object anew.
</Warning>

The sample code below demonstrates applying the **Reset** method to an object. As a result, the **menu** object becomes invalid and cannot be referred to.

```
// Define a new IMainMenu object and initialize it
IMainMenu menu = TaskWindow.MainWindow.MainMenu;
// Call the Reset method
menu.Reset();
```
