Executes a command over the given selection or text range.
Syntax
bSuccess = object.execCommand(sCommand [, bUserInterface] [, vValue])
Parameters
sCommand Required. String that specifies the command to execute, which can be any valid command identifier. bUserInterface Optional. Boolean that specifies one of the following values:
false Default. Does not display a user interface. true Displays a user interface, if the command supports one. vValue Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on sCommand.
Return Value
Boolean. Returns true if the command is successful, or false otherwise.
Remarks
Do not invoke the execCommand method until after the page loads.
Applies To
document, controlRange, TextRange
See Also
queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue