سؤال

I would like to write a macro that works on the selected table.

Selection in a table

When I select a table, the object that ThisComponent.CurrentSelection returns is of type SwXTextTableCursor. I will refer to it generically as TextTableCursor.

According to DBG_methods it provides methods to traverse through the selected cells and merge or split the cells, but it doesn't seem to provide a way to access the actual table itself. Conversely, ThisComponent.TextTables returns the tables.

As far as I can tell, there is no way to determine if some cells or all of a table is selected.

Question

Is there any way to retrieve the TextTable(s) from TextTableCursor?

هل كانت مفيدة؟

المحلول

To get current selected TextTable use

ThisComponent.CurrentController.ViewCursor.TextTable
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top