Hi
When I create tables with more than 7 columns using DocumentBuilder, I get the following error when opening the resulting Word doc: “A table in this document has become corrupted…”.
I am using Word 2000(9.0.6926 SP-3) and (I think) the latest version of Aspose Word (dll version 2.1.1.0). The error can be replicated using the following code:
Aspose.Word.Word.SetLicense(this.Server.MapPath(“Aspose.Office.lic”),this);
Document doc = new Document(MapPath(“myTemplate.dot”));
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToMergeField(“startExtract”);
builder.ParagraphFormat.ClearFormatting();
builder.ParagraphFormat.StyleName = “Heading 2”;
builder.Writeln(“Table Title”);
builder.ParagraphFormat.StyleName = “TableBody”;
builder.RowFormat.HeightRule = RowHeightRule.Auto;
builder.CellFormat.VerticalAlignment = CellVerticalAlignment.Center;
foreach (Border border in builder.CellFormat.Borders)
{
border.LineStyle = LineStyle.Single;
border.LineWidth = 1;
border.Color = System.Drawing.Color.Black;
}
builder.CellFormat.Width = 50;
for(int i=0; i<20; ++i)
{
for(int j=0;j<8; ++j)
{
builder.InsertCell();
builder.Write(string.Format(“cell{0} row{1}”,j,i));
}
builder.EndRow();
}
builder.EndTable();
doc.MailMerge.DeleteFields();
doc.Save(“testExtract.doc”, SaveFormat.FormatDocument, SaveType.OpenInWord, this.Response);
Is this a known issue. I can send you a copy of my template if that would help.
Regards
Mike Cook