Skip to main content

Hyperlink Class

Defines a hyperlink in the document.

Declaration

export class Hyperlink extends Field

Remarks

var text = "Visit our site";
var url = "https://www.devexpress.com/";
var tooltip = "DevExpress site";

richEdit.beginUpdate();
richEdit.history.beginTransaction();
var subDocument = richEdit.selection.activeSubDocument;

var position = richEdit.selection.active;
position = subDocument.insertParagraph(position).interval.end;
position = subDocument.hyperlinks.create(position, new DevExpress.RichEdit.HyperlinkInfo(text, url, "", tooltip)).interval.end;
subDocument.insertParagraph(position);

richEdit.endUpdate();
richEdit.history.endTransaction();

Inheritance

Field
Hyperlink

Properties

Provide access to information about a hyperlink.

get hyperlinkInfo(): HyperlinkInfo
set hyperlinkInfo(hyperlinkInfo: HyperlinkInfo)
Type Description
HyperlinkInfo

An object that contain information about a hyperlink.

// Gets URLs of all hyperlinks in the main sub-document
var hyperlinks = richEdit.document.hyperlinks;
var hyperlinkUrls = [];
for(var i = 0, hyperlink; hyperlink = hyperlinks.getByIndex(i); i++)
    if (hyperlink.hyperlinkInfo.url)
        hyperlinkUrls.push(hyperlink.hyperlinkInfo.url);
See Also