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

Free Support Forum - aspose.com

Identifying a cell using bookmark


For identifying a cell in the table, I added a bookmark to the cell. how to get that bookmarked cell from the table. Is there any way to find. Please help me ASAP


Please use Node.GetAncestor method (NodeType) to get the first ancestor of the specified NodeType. Following code example shows how to get the bookmarked table’s cell.

Document doc = new Document(MyDir + "in.docx");
Bookmark bookmark = doc.Range.Bookmarks["bookmarknameInCell"];
Cell cell = (Cell)bookmark.BookmarkStart.GetAncestor(NodeType.Cell);
if (cell != null)
    //Your code...

Hope this helps you.


Thanks for your reply. It works great.