Getting an error of exception row not selected and hence could not perform insert column operation
public void tableinsertcol()
{
// see if a table selected or insertion point inside a table
mshtmlTable table = null;
IHTMLTableRow row = null;
mshtmlTableCell cell = null;
GetTableElement(out table, out row);
// process according to table being defined
if (table != null && row != null)
{
try
{
// find the existing row the user is on and perform the insertion
int index = cell.cellIndex;
foreach (mshtml.IHTMLTableRow rows in table.rows)
{
row.insertCell(index);
}
}
catch (Exception ex)
{
throw new HtmlEditorException("Unable to insert a new Row", "TableinsertRow", ex);
}
}
else
{
throw new HtmlEditorException("Row not currently selected within the table", "TableInsertRow");
}
}