[Solved] Writer: merge cells in a table using Basic
Posted: Tue Jan 23, 2024 3:39 pm
Hi,
I'm trying to merge some cells in a table in Writer programmatically. My current code (all variables are declared):
The anchor is obtained from a bookmark inside the table, and I want to merge cells starting from the anchored cell to the right end of the table. The code executes up to the last line, and then I get the error message: "Instance member MERGE does not exist".
How can I merge some cells in code?
TIA
I'm trying to merge some cells in a table in Writer programmatically. My current code (all variables are declared):
Code: Select all
Set cell= anchor.Cell
Set tbl= anchor.textTable
col = Asc(Left$(cell.CellName,1)) - Asc("A")
row = CInt(Mid$(cell.CellName, 2)) - 1
rf1= Chr$(Asc("A")+ col) & (row+1) & ":" & Chr$(Asc("A")+ tbl.getColumns().getCount()-1) & (row+1)
Set cr2= tbl.getCellRangeByName(rf1)
Call cr2.merge(True)
How can I merge some cells in code?
TIA