Skip to main content

Bookmark

Get a bookmark interval by its name

var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
    var bookmarkInterval = bookmark.interval;
}

Insert a bookmark

var textInterval = richEdit.document.insertText(0, 'text');
var bookmark = richEdit.document.bookmarks.create(textInterval, 'bookmarkName');

Scroll to a bookmark

var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark)
    bookmark.goTo();