Use MoveToCell if you need to move the cursor to a table cell in the current section. This method accepts four parameters:
- tableIndex - the index of the table to move to.
- rowIndex - the index of the row in the table.
- columnIndex - the index of the column in the table.
- characterIndex - the index of the character inside the cell.
The navigation is performed inside the current story of the current section.
For the index parameters, when index is greater than or equal to 0, it specifies an index from the beginning with 0 being the first element. When index is less than 0, it specifies an index from the end with -1 being the last element.
Also, note that characterIndex currently can only specify 0 to move to the beginning of the cell or -1 to move to the end of the cell.
Example DocumentBuilderMoveToTableCell
Shows how to move a cursor position to the specified table cell.
[C#]
Document doc = new Document(MyDir + "DocumentBuilder.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
// Move to the 2nd table, 3rd row, 5th cell.
builder.MoveToCell(1, 2, 4, 0);
builder.Writeln("Hello World!");
[Visual Basic]
Dim doc As Document = New Document(MyDir & "DocumentBuilder.doc")
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
' Move to the 2nd table, 3rd row, 5th cell.
builder.MoveToCell(1, 2, 4, 0)
builder.Writeln("Hello World!")
[Java]
Document doc = new Document(getMyDir() + "DocumentBuilder.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
// Move to the 2nd table, 3rd row, 5th cell.
builder.moveToCell(1, 2, 4, 0);
builder.writeln("Hello World!");