Talk:Documentation/Wiki Books

From Apache OpenOffice Wiki
< Talk:Documentation
Revision as of 16:42, 10 October 2009 by Pastor (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Personal tools