Hi Tom,
Please take a look at the following topic in the documentation:
http://helpopenvision.nevron.com/#WorkingWithTextDocuments_Selection.htmlYou can get the currently selected inline and dig your way up the tree using the following code:
nRichTextViewWithRibbonControl1.Widget.View.SaveToFile("c:\\temp\\test.pdf", new Nevron.Nov.Text.Formats.NPdfTextFormat());
NSelection selection = nRichTextViewWithRibbonControl1.Widget.View.Selection;
if (selection.Mode == ENSelectionMode.Caret)
{
NTable table = (NTable)selection.GetSelectedInlines(false)[0].GetFirstAncestor(NTable.NTableSchema);
table.BackgroundFill = new NColorFill(NColor.Red);
}
The idea is to get the current inline where the cursor is located and then try to get the first table that contains it. The code specifically checks whether the selection mode is caret so that it avoids the Range selection mode in which you can have two or more tables selected simultaneously.
Hope this helps - let us know if you have any questions.
Best Regards,
Nevron Support Team