We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

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
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 ?



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 = "";