Skip to main content

CreateSubMenuItem

Description

Creates a new SubMenu for already created Menu.

Syntax

// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.CreateSubMenuItem(
parentMenuItemId,
customCommand,
orderPriority,
);

Parameters

NameOptionalityTypeDescription
parentMenuItemIdRequirednumberID of the Parent MenuItem.
customCommandRequirednumberCommand to execute when the MenuItem is selected.
orderPriorityRequirednumberPriority to assign to the new item.

Return type

TypeDescription
Promise < number >ID of the newly created MenuItem.

Exceptions

ArgumentError - parentMenuItemId, customCommand, or orderPriority is null or undefined, or when a builtin command is used as parent that doesn't support submenus.

NotFoundError - When the parent menu item or command is not found or access is denied.

DuplicateCommandError - When the command already exists in the menu.

InvalidOperationError - When the command location ID is null or undefined.