ChangeHyperlinkCommand.execute(fieldIndex, hyperlinkSettings) Method
In This Article
Executes the ChangeHyperlinkCommand command with the specified parameters.
#Declaration
TypeScript
execute(
fieldIndex: number,
hyperlinkSettings: HyperlinkSettings,
subDocumentId?: number
): boolean
#Parameters
Name | Type | Description |
---|---|---|
field |
number | The field’s index in the specified sub-document. |
hyperlink |
Hyperlink |
An object specifying the hyperlink’s properties. |
sub |
number | A value that specifies the sub-document. |
#Returns
Type | Description |
---|---|
boolean |
|
#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