Method ReplaceContent
ReplaceContent(BookmarkReference, string, CharacterFormat?)
Replaces the content the bookmark spans with a single text run.
public static TextRun ReplaceContent(this BookmarkReference bookmark, string text, CharacterFormat? format = null)
Parameters
bookmarkBookmarkReferenceThe bookmark.
textstringThe replacement text.
formatCharacterFormatThe replacement formatting, or null to inherit from the first run the bookmark spanned — the same default find and replace uses.
Returns
- TextRun
The inserted run.
Exceptions
- ArgumentNullException
An argument is null.