Identifying a cell using bookmark

Hi,

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

@Gptrnt

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.

Hi,

Thanks for your reply. It works great.