Hi Laurentius,
Thank you for your inquiry.
The first thing would be to decide where you need a bookmark. It could be a string of text, a picture or simply a blank space somewhere. Now highlight the text, or select the picture, or put the cursor in the spot where the bookmark should be located. Next you’ll need the Insert menu, Bookmark choice. (Ctrl + Shift + F5 will also open the Bookmark window.)
Use following code snippet to remove table:
// Create document object
Document doc = new Document("d:/temp/temp.docx");
// Use the indexer of the Bookmarks collection to obtain the desired bookmark.
Bookmark bookmark = doc.getRange().getBookmarks().get("MyBookmark");
// Get the table that this bookmark is contained in.
Table table = (Table) bookmark.getBookmarkStart().getAncestor(NodeType.TABLE);
// Remove the table
table.remove();
I would like to suggest some informational links:
https://reference.aspose.com/words/java/com.aspose.words/documentbuilder/#moveToSection-int
https://blog.aspose.com/2012/01/04/new-mail-merge-cleanup-options-in-aspose.words-for-.net-and-java
https://reference.aspose.com/words/java/com.aspose.words/bookmark/
Hope this will help you.