I need to find some text in the Writer table, then get contents of the cell right of the found text into the variable. Text is found successfully with this code:
Sub get_contr_num
dim oDoc as Object
dim oFound as Object
dim oDescriptor
dim oCursor as Object
oDoc = ThisComponent
oDescriptor = oDoc.createSearchDescriptor()
oDescriptor.SearchString = "Contract *No"
oDescriptor.SearchRegularExpression = true
oFound=oDoc.FindFirst(oDescriptor)
End Sub
Now I need to get contents of the right cell. As I understand, oFound
is an object of XTextRange
, and I need XCellRange
with row and column parameters. How do I do this?