Hi Devin,

Devin Bayer schrieb:
Hello. I'm using pyuno and writer documents. I want to duplicate rows that contain certain words. Currently I'm doing this by looking at each cell and searching it for the text, ignoring results past the end of the cell's XTextRange.

This would be a lot easier if I could locate the containing row and table with just the search result.

I think I can use range.getText() to find the containing cell, and I even see cell.CellName, but then I don't know how to find the containing table.

With a XSearchDescriptor you can find all XTextRanges which match your requirements. Then iterate over the collection and query for the XPropertySetInfo of your range.
The xTextRange has a property by name "TextTable". Query for it.
If the XTextTable is null, then your xTextRange is outside a table, otherwise inside and you get your XTextTable interface.

Regards

Peter







---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to