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

Bookmark Class

A bookmark in the document.

#Declaration

TypeScript
export class Bookmark

#Remarks

The example below demonstrates how to create a bookmark:

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

Refer to the following topic for more examples: Bookmark.

#Inheritance

Bookmark

#Properties

#index Property

Gets the bookmark’s index in a bookmark collection.

#Declaration

TypeScript
get index(): number

#Property Value

Type Description
number

A zero-based index.

#interval Property

Gets the text buffer interval that contains the bookmark.

#Declaration

TypeScript
get interval(): Interval

#Property Value

Type Description
Interval

The text buffer interval.

#Remarks

// returns a text of the specified bookmark
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
    var text = bookmark.subDocument.getText(bookmark.interval);
}

#name Property

Returns a name of the bookmark.

#Declaration

TypeScript
get name(): string

#Property Value

Type Description
string

The bookmark name.

#Remarks

A bookmark name should start with a letter and must be unique in the collection of bookmarks in the current document.

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

#subDocument Property

Gets a sub-document where the bookmark is placed.

#Declaration

TypeScript
get subDocument(): SubDocument

#Property Value

Type Description
SubDocument

The sub-document that contains the bookmark.

#Remarks

// returns a text of the specified bookmark
var bookmark = richEdit.document.bookmarks.find('bookmarkName')[0];
if (bookmark) {
    var text = bookmark.subDocument.getText(bookmark.interval);
}

#Methods

#delete Method

Deletes the bookmark.

#Declaration

TypeScript
delete(): void

#Remarks

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