ChangeHyperlinkCommand.execute(fieldIndex, hyperlinkSettings) Method

Executes the ChangeHyperlinkCommand command with the specified parameters.


execute(fieldIndex: number, hyperlinkSettings: HyperlinkSettings, subDocumentId?: number): boolean


Name Type Description
fieldIndex number

An integer value specifying the field's index in the specified sub-document.

hyperlinkSettings HyperlinkSettings

An object specifying the hyperlink's properties.

subDocumentId number

A nullable value specifying the sub-document.


Type Description

true if the command has been successfully executed; false if the command execution has failed.


Usage example:

var field = richEdit.document.activeSubDocument.findFields(richEdit.selection.intervals[0].start)[0];
if (field && field.isHyperlink){
    var hyperlinkSettings = new ASPx.HyperlinkSettings ("", "", "click me", "go to google");
    richEdit.commands.changeHyperlink.execute(field.index, hyperlinkSettings);

Use the Field.isHyperlink property to determine whether the specified field is a hyperlink.

See Also