hi
how can I merge cells in a writer table by macro (basic?).
(it will be nice if somebody have a short example!)
thank you
heinz
[Solved] How to merge some cells in a Writer - table (Basic)
-
- Posts: 4
- Joined: Mon Nov 30, 2009 7:27 pm
[Solved] How to merge some cells in a Writer - table (Basic)
Last edited by heinz_aus_graz on Mon Jan 11, 2010 12:18 pm, edited 1 time in total.
OpenOffice 3.1 on Windows XP
Re: How to merge some cells in a writer - table (Basic)
You can do this with a TextTableCursor. You can see the methods available to the cursor here. Here is some code for a document I made that contains just one table. The cursor is created in cell A2, is expanded one cell to the right and one cell down, so it cover A2:B3. That range is then merged.
Code: Select all
oDoc = ThisComponent
oTables = oDoc.TextTables
oTable = oTables.getByIndex(0)
Curs = oTable.createCursorByCellName("A2")
Curs.goRight(1,True)
Curs.goDown(1,True)
Curs.mergeRange()
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.