Method DeleteContent
DeleteContent(BookmarkReference)
Deletes the content the bookmark spans, leaving both markers in place so the bookmark survives as an insertion point.
When the markers sit in different paragraphs the paragraphs are joined, which is what deleting a range that crosses a paragraph mark means: the mark is part of the deleted range. The surviving paragraph keeps the start paragraph's own formatting.
public static int DeleteContent(this BookmarkReference bookmark)
Parameters
bookmarkBookmarkReferenceThe bookmark.
Returns
- int
The number of inlines removed.
Exceptions
- ArgumentNullException
bookmarkis null.- InvalidOperationException
The markers sit in paragraphs with different parents, so the span cannot be joined.