How do i delete nodes contained inside a bookmark that are rows or paragrahs?

As said i wanted to iterate over the nodes contained inside a specific bookmark and remove only those that are either paragraphs or table rows.

How can i proceed ?

Thanks in advance.

@aaronArchest the way to get the content inside a bookmark is retrieve content between BookmarkStart and BookmarkEnd you can use ExtractContent method from this article

Bookmark bookmark = srcDoc.Range.Bookmarks["BookmarkName"];
// Get node that contains BookmarkStart and BookmarkEnd
Node startParentNode = bookmark.BookmarkStart.ParentNode;
Node endParentNode = bookmark.BookmarkEnd.ParentNode;
ExtractContent(startParentNode, endParentNode);
1 Like

thank you very much !