Hi,
I suppose :
- you are working on a Writer document
- your tables are simple, regularly squared : no cell merged, no split cells.
This example works on a table, explores lines from bottom to top, deletes lines
where the first cell has a specific string.
REM ***** BASIC ***
Dim aTable As Object, allRows As Object, firstCell As Object
Dim y As Long
aTable = ThisComponent.getTextTables.getByIndex(0)
allRows = aTable.getRows
for y = allRows.getCount -1 to 0 step -1
firstCell = aTable.getCellByPosition(0,y)
if firstCell.String = "dd" then
allRows.removeByIndex(y, 1)
end if
next
Questions like this are more easily answered in the community forum
<https://forum.openoffice.org/en/forum/>
Regards
Bernard
Message de IMMO WETZEL date 2014-06-26 09:25 :
I'm working on a huge document with a lot of tables and images and so on.
Now I have to modify a table and to delete empty/unused rows. Every Row has an
unique text string in the first cell.
How can I delete these rows without knowing the exact position of this row.
Are the any way to fill the removebyindex function with data ?
I guess there must be something like
- Search the text
- Detect the row number
- Remove the row
But I couldn't find it
Immo
---------------------------------------------------------------------
To unsubscribe, e-mail: api-unsubscr...@openoffice.apache.org
For additional commands, e-mail: api-h...@openoffice.apache.org