# Bookmark

A `Bookmark` refers to a location in the document and has a unique name, which identifies it. Every `Bookmark` has a corresponding `BookmarkRangeStart` and `BookmarkRangeEnd`, which are inline elements. These two elements specify the bookmark location as follows:

* `BookmarkRangeStart`: Specifies the start of a bookmark annotation.
* `BookmarkRangeEnd`: Specifies the end of a bookmark annotation.

## Inserting a Bookmark

**Example 1** shows how to create a `Bookmark` and add its `BookmarkRangeStart` and `BookmarkRangeEnd` elements in a [Paragraph](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/model/paragraph):

**Example 1: Create a bookmark and place its start and end markers around a run in a paragraph**

```C#
Bookmark bookmark = new Bookmark(document, "MyBookmark");
paragraph.Inlines.Add(bookmark.BookmarkRangeStart);
paragraph.Inlines.AddRun("text");
paragraph.Inlines.Add(bookmark.BookmarkRangeEnd);
```

The paragraph must belong to the same document that is passed to the constructor of the `Bookmark` object. Otherwise, an exception is thrown. The bookmark location is specified around a run with text "*text*".

You can also insert a `Bookmark` in the document with the [RadFlowDocumentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/editing/radflowdocumenteditor) class as shown in **Example 2**:

**Example 2: Insert a bookmark named MyBookmark with RadFlowDocumentEditor**

```C#
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(new RadFlowDocument());
Bookmark bookmark = editor.InsertBookmark("MyBookmark");
```

The `InsertBookmark()` method from **Example 2** creates a `Bookmark` with name "*MyBookmark*" and inserts its `BookmarkRangeStart` and `BookmarkRangeEnd` elements one after another.

## Removing a Bookmark

You can remove an inserted `Bookmark` by using the `DeleteBookmark()` method of `RadFlowDocumentEditor`. Pass the name of the bookmark to remove, or the `Bookmark` instance itself, to the method.

**Example 3** demonstrates how to delete the bookmark created in **Example 2**.

**Example 3: Delete a bookmark by name with RadFlowDocumentEditor**

```C#
editor.DeleteBookmark("MyBookmark");
```

## See Also

* [Paragraph](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/model/paragraph)
* [RadFlowDocumentEditor](https://www.telerik.com/document-processing-libraries/documentation/libraries/radwordsprocessing/editing/radflowdocumenteditor)
* [Finding a Table Containing a Specific Bookmark in Word Documents](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/radwordsprocessing-find-table-by-bookmark)
* [Change Bookmark Content While Preserving Formatting](https://www.telerik.com/document-processing-libraries/documentation/knowledge-base/radwordsprocessing-change-bookmark-content-preserve-formatting)
