Skip to main content
A newer version of this page is available. .

SetParagraphLevelCommand.execute(level) Method

Executes the SetParagraphLevelCommand command by applying the specified setting.

May result in taking no action if the command’s state does not allow command execution. Use the object’s getState method to check the command state.

Declaration

execute(
    level: number
): boolean

Parameters

Name Type Description
level number

An integer value specifying the applied style. The value should be in the range from 0 to 9.

Returns

Type Description
boolean

A Boolean value identifying whether method execution was successful or failed.

Remarks

The execute method checks the command state (obtained using the getState method) before executing, and decides whether the action can be performed.

The RichEditCommands.setParagraphLevel method allows you to control whether the selected paragraphs are displayed in a table of contents depending on the level parameter’s value:

  • 0 - the selected paragraphs are not shown in the table of contents;
  • 1 - 9 - the selected paragraphs are shown in the table of contents on the corresponding level.

Usage example:


richEdit.commands.setParagraphLevel.execute(2);
See Also