How to remove bookmark WITH content (including nested stuff)

Our “old” code is with Words 15.2, now trying out the newest verison (20.10).
However, the function
RemoveBookmarkWithContent
previously found in aspose support (I I recall right) is now failing.

Is there a newer / better way to remove a bookmark, including its content, which possibley can be nested tables, paragraphs ect and NOT just a simple text), or is there an updated version of this function ?

:slight_smile:

@tokebreer2,

You can remove a Bookmark from Word document along with the Bookmarked content by using the following C# code of Aspose.Words for .NET:

Document doc = new Document("C:\\temp\\input.docx");
Bookmark bookmark = doc.Range.Bookmarks["bm"];
bookmark.Text = "";
bookmark.Remove();
doc.Save("C:\\temp\\output.docx");