public static string PrintCellMergeType(Cell cell)
{
bool isHorizontallyMerged = cell.CellFormat.HorizontalMerge != CellMerge.None;
bool isVerticallyMerged = cell.CellFormat.VerticalMerge != CellMerge.None;
string cellLocation = string.Format("R{0}, C{1}", cell.ParentRow.ParentTable.IndexOf(cell.ParentRow) + 1, cell.ParentRow.IndexOf(cell) + 1);
if (isHorizontallyMerged && isVerticallyMerged)
return string.Format("The cell at {0} is both horizontally and vertically merged", cellLocation);
else if (isHorizontallyMerged)
return string.Format("The cell at {0} is horizontally merged.", cellLocation);
else if (isVerticallyMerged)
return string.Format("The cell at {0} is vertically merged", cellLocation);
else
return string.Format("The cell at {0} is not merged", cellLocation);
}
// ExEnd:PrintCellMergeType