Macros/Writer/008/es

Description
For LibreOffice Writer, we wish to write a macro which emulates the functionality of.

We will use the dispatcher to engage the command .uno:ConvertTableToText (this part of the code is can be recorded with if  is enabled).

The macro starts by positioning the cursor in the table with the Select method of CurrentController and passing it the cursor created in the table.

For the below example, a table with the name "Table2" is converted.

Accessing of the table will be done through the method getByName from the service TextTables. The method ''' com.sun.star. text.createCursorByCellName''' allows for creation of a cursor in cell A1. This cursor is then used for selectioning in the table and can hence do the converting.

Code
In LibreOffice Basic:

ODT file to test macro

 * [[Media:Example macro to convert table to text.odt|Download example ODT file with this macro embedded]]