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

# IMenu

> Customize FlexiCapture station menus with the IMenu collection: append, insert, find, and delete menu items identified by TCommandID command identifiers.

## What it does

A collection of [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem) objects. Represents a menu or a submenu.

## Methods

| **Definition**                                                                                                                                                                      | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AppendItem( commandId : [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid), text : string ) : [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem)              | Appends a menu item with the command identifier **commandId** and the text **Text** at the end of the menu. Returns the [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem) object of the corresponding element. Any identifiers from the [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid) enumeration may be used (including **CI\_SubMenu** and **CI\_Separator**), except for **CI\_Undefined**. For **CI\_Separator**, the **Text** parameter will be ignored.            |
| Delete( index : int )                                                                                                                                                               | Deletes an element by its index in the collection.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Find( commandId : [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid) ) : int                                                                                            | Finds the index of the first object with the specified ID of the command in the collection.                                                                                                                                                                                                                                                                                                                                                                                                          |
| InsertItem( index : int, commandId : [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid), text : string ) : [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem) | Inserts a menu item with the command identifier **commandId** and the text **Text** in the position Index of the menu. Returns the [IMenuItem](/flexi-capture/appendix/scripts-shell/imenuitem) object of the corresponding element. Any identifiers from the [TCommandID](/flexi-capture/appendix/scripts-shell/tcommandid) enumeration may be used (including **CI\_SubMenu** and **CI\_Separator**), except for **CI\_Undefined**. For **CI\_Separator**, the **Text** parameter will be ignored. |
