Hi,
I’m using Documentvisitor to extract table from word document to create a xml file, I want to know at every cell if it’s Verticaly Merged and how many time. So what I do:
public override VisitorAction VisitCellStart(Aspose.Words.Tables.Cell cell)
{
try
{
if (cell.CellFormat.VerticalMerge != CellMerge.Previous)
{
_mIsSkipCell = false;
_mTableCellElem = _mXmlDoc.CreateElement("TableCell");
_mTableCellElem.SetAttribute("HorizontalAlignment", cell.Paragraphs[0].ParagraphFormat.Alignment.ToString().ToLower());
_mTableCellElem.SetAttribute("VerticalAlignment", cell.CellFormat.VerticalAlignment.ToString().ToLower());
_mTableCellElem.SetAttribute("BorderWidthBottom", cell.CellFormat.Borders.Bottom.LineWidth.ToString());
_mTableCellElem.SetAttribute("BorderWidthLeft", cell.CellFormat.Borders.Left.LineWidth.ToString());
_mTableCellElem.SetAttribute("BorderWidthRight", cell.CellFormat.Borders.Right.LineWidth.ToString());
_mTableCellElem.SetAttribute("BorderWidthTop", cell.CellFormat.Borders.Top.LineWidth.ToString());
if (cell.CellFormat.VerticalMerge == CellMerge.First)
{
_mTableCellElem.SetAttribute("Rowspan", cell.CellFormat.???????);
}
_mXmlTableCell = new XmlTableCell(_mTableCellElem, _mXmlTableRow.ThisElement);
_mXmlTableRow.AddCell(_mXmlTableCell);
}
else
{
_mIsSkipCell = true;
}
return VisitorAction.Continue;
How can I figure out the number of RowSpan (how many time this cell is merged verically?)?
_mTableCellElem.SetAttribute("Rowspan",?????);
where ??? is the number of merged verically cells
Thanks