Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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);
var text = 'Go to Google';
var url = 'https://www.google.com/';
var hyperlinkInfo = new DevExpress.RichEdit.HyperlinkInfo(text, url, undefined, 'tooltip');
richEdit.selection.activeSubDocument.hyperlinks.create(richEdit.selection.active, hyperlinkInfo);
var subDocument = richEdit.selection.activeSubDocument;
var currentPosition = richEdit.selection.active;
// Creates a bookmark at the current position
subDocument.insertText(currentPosition, 'Some text');
var interval = new DevExpress.RichEdit.Interval(currentPosition, 'Some text'.length);
var bkm = subDocument.bookmarks.create(interval, 'bkmName');
// Creates a hyperlink to the bookmark at the end of the active sub-document
var hyperlinkInfo = new DevExpress.RichEdit.HyperlinkInfo('Go to Bookmark', undefined, bkm.name, 'tooltip');
var hyperlink = subDocument.hyperlinks.create(subDocument.length - 1, hyperlinkInfo);