public void PrintTableRange()
{
//ExStart
//ExId:PrintTableRange
//ExSummary:Shows how to print the text range of a table.
Document doc = new Document(MyDir + "Table.SimpleTable.doc");
// Get the first table in the document.
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
// The range text will include control characters such as "\a" for a cell.
// You can call ToString on the desired node to retrieve the plain text content.
// Print the plain text range of the table to the screen.
Console.WriteLine("Contents of the table: ");
Console.WriteLine(table.Range.Text);
//ExEnd
//ExStart
//ExId:PrintRowAndCellRange
//ExSummary:Shows how to print the text range of row and table elements.
// Print the contents of the second row to the screen.
Console.WriteLine("\nContents of the row: ");
Console.WriteLine(table.Rows[1].Range.Text);
// Print the contents of the last cell in the table to the screen.
Console.WriteLine("\nContents of the cell: ");
Console.WriteLine(table.LastRow.LastCell.Range.Text);
//ExEnd
Assert.AreEqual("Apples\r" + ControlChar.Cell + "20\r" + ControlChar.Cell + ControlChar.Cell, table.Rows[1].Range.Text);
Assert.AreEqual("50\r\a", table.LastRow.LastCell.Range.Text);
}