The requested page is not available for the requested platform. You are viewing the content for Default platform.

ChangeHyperlinkCommand.execute(fieldIndex, hyperlinkSettings) Method

Executes the ChangeHyperlinkCommand command with the specified parameters.

Declaration

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

Parameters

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.

Optional Parameters

Name Type Default Description
subDocumentId number null

A nullable value specifying the sub-document.

Returns

Type Description
boolean

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

Remarks

Usage example:


var field = richEdit.document.activeSubDocument.findFields(richEdit.selection.intervals[0].start)[0];
if (field && field.isHyperlink){
    var hyperlinkSettings = new ASPx.HyperlinkSettings ("google.com", "", "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