TableFromSelection

Description

Gets the ID of the currently selected table.

Applies to

RichTextEdit control

Syntax

long rtename.TableFromSelection(ref long row, ref long column)

Argument

Description

row The row number that is currently selected. If no row is selected or multiple rows are selected, the row number is 0.
column The column number that is currently selected. If no column is selected or multiple columns are selected, the column number is 0.

Return value

Long.

Returns the ID of the table that is currently selected. Returns 0 if no table is selected or multiple tables are selected. Returns null if any argument is null.

Examples

The following examples gets the ID of the currently-selected table:

long ll_tableid,ll_rtn,ll_row,ll_col

ll_tableid = rte_1.TableInsert(3,4)

//Select a table cell
rte_1.TableCellSelect(ll_tableid,2,2)
ll_rtn = rte_1.TableFromSelection(ll_row,ll_col)
messagebox("TableFromSelection","Table ID:" + string(ll_rtn) + "~tRow:" + string(ll_row) + "~tCol:" + string(ll_col))

//Select a range of table cells
rte_1.TableCellSelect(ll_tableid,1,2,3,3)
ll_rtn = rte_1.TableFromSelection(ll_row,ll_col)
messagebox("TableFromSelection","Table ID:" + string(ll_rtn) + "~tRow:" + string(ll_row) + "~tCol:" + string(ll_col))