Talk:Documentation/Wiki Books
From Apache OpenOffice Wiki
I am trying to learn OOBasic, by copying examples from the book and manipulating them. I found this example that is broken. Page 125 "Cells"
Dim Doc As Object Dim Table As Object Dim Cursor As Object Dim Rows As Object Dim RowIndex As Integer Dim Cols As Object Dim ColIndex As Integer Dim CellName As String Dim Cell As Object Doc = StarDesktop.CurrentComponent Cursor = Doc.Text.createTextCursor() <=========================== "Property or Method not found." Table = Doc.createInstance("com.sun.star.text.TextTable") Table.initialize(5, 4) Doc.Text.insertTextContent(Cursor, Table, False) Rows = Table.getRows Cols = Table.getColumns For RowIndex = 1 To Rows.getCount()
For ColIndex = 1 To Cols.getCount() CellName = Chr(Asc("A") - 1 + ColIndex) & RowIndex Cell = Table.getCellByName(CellName) Cell.String = "row: " & CStr(RowIndex) + ", column: " & CStr(ColIndex) Next
Next