Borders showing up when I don't want them (multiple tables)


#1

I have 1 merge field in a doc file.

I use insertHTML to insert a table for ex.

....

then in the same merfield a second table but BORDER=0

The problem is that I still see the border in the second table.

After upgrading to 3.5 it has removed the inside borders, but the outside borders remain. I notice that if I view the code of the .doc file it has border=1 at the table level, even though I said border=0 explicitly.

Please help. Thanks.


#2

Thanks for reporting. The problem was logged to our defect base as Issue #776. We will try to correct this problem in the next hotfix.

Meanwhile, you can use the following code as a temporary workaround:

builder.InsertHtml(@"

...
");

// set all borders of the previously inserted table to none
foreach(Row row in ((Table)builder.CurrentParagraph.PreviousSibling).Rows) {
foreach(Border border in row.RowFormat.Borders) {
border.LineStyle = LineStyle.None;
}
}


#3

Fixed in Aspose.Words 3.5.2:

http://www.aspose.com/Downloads/Aspose.Words/3.5.2.0/Default.aspx