Difference between revisions of "Talk:Documentation/Wiki Books"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Propery or Method not found error.)
 
m (Property or Method not found error)
Line 1: Line 1:
I am trying to learn OOBasic, by copying examples from the book and manipulating them. I found this example that is broken.
+
"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"
 
Page 125 "Cells"
 
+
The line: Cursor = Doc.Text.createTextCursor() causes a "Property or Method not found error."  
Dim  Doc As Object
+
BTW, this example is identical to the example in the StarBasic manual (which also has the same error)."
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
+

Revision as of 16:49, 10 October 2009

"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" The line: Cursor = Doc.Text.createTextCursor() causes a "Property or Method not found error." BTW, this example is identical to the example in the StarBasic manual (which also has the same error)."

Personal tools