Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordBookmark

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

Represents a bookmark within a Word document.

Inheritance

Usage

Explore 13 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Methods

public static WordBookmark AddBookmark(WordParagraph paragraph, string bookmarkName) #

Adds a bookmark to the specified paragraph.

Parameters

paragraph OfficeIMO.Word.WordParagraph required
Paragraph to contain the bookmark.
bookmarkName string required
Name of the bookmark.

Returns

WordBookmark The created bookmark.
public WordRange GetRange() #

Returns the range between the bookmark's start and end.

Returns

WordRange The bookmarked range; empty when the bookmark marks a position rather than text.
public void Remove() #

Removes the bookmark from the document.

Properties

public WordParagraph Paragraph { get; } #

Gets the paragraph containing the bookmark.

public string? Name { get; set; } #

Gets or sets the bookmark name.

public int Id { get; set; } #

Gets or sets the bookmark identifier.

public string Text { get; set; } #

Gets or sets the text the bookmark spans. Paragraph breaks are returned as \n. Setting the text replaces the bookmarked content and keeps the bookmark around the new text, so REF and cross-reference fields show it after their next update.