public void CellFormatProperties()
{
//ExStart
//ExFor:CellFormat
//ExFor:Cell.CellFormat
//ExId:CellFormatProperties
//ExSummary:Shows how to modify formatting of a table cell.
Document doc = new Document(MyDir + "Table.Document.doc");
Table table = (Table)doc.GetChild(NodeType.Table, 0, true);
// Retrieve the first cell in the table.
Cell firstCell = table.FirstRow.FirstCell;
// Modify some row level properties.
firstCell.CellFormat.Width = 30; // in points
firstCell.CellFormat.Orientation = TextOrientation.Downward;
firstCell.CellFormat.Shading.ForegroundPatternColor = Color.LightGreen;
//ExEnd
doc.Save(MyDir + @"\Artifacts\Table.CellFormat.doc");
doc = new Document(MyDir + @"\Artifacts\Table.CellFormat.doc");
table = (Table)doc.GetChild(NodeType.Table, 0, true);
Assert.AreEqual(30, table.FirstRow.FirstCell.CellFormat.Width);
Assert.AreEqual(TextOrientation.Downward, table.FirstRow.FirstCell.CellFormat.Orientation);
Assert.AreEqual(Color.LightGreen.ToArgb(), table.FirstRow.FirstCell.CellFormat.Shading.ForegroundPatternColor.ToArgb());
}