We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cellformat drawing right border works on one cell but not another

I have a header table in a word document (see attachment below), I had removed some cells and it has messed up my table border. The code below should work for both cells, but only one works.

'Re-draw right border

headerTable.Rows(3).Cells(3).CellFormat.Borders.Right.LineWidth = 2.25 <-- that workds

headerTable.Rows(4).Cells(1).CellFormat.Borders.Right.LineWidth = 2.25 <-- that didn't??

What can I do to make row 4, cell 1 set to with 2.25? I also tried doing RowFormat and that didn't work either. Please help! Thanks!

P.S: Sorry I sent the example without data, but the cell that works doesn't have any data but the cell that doesn't have data...does that matter?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. Please try also setting LineStyle and color as shown in the following code:

headerTable.Rows(4).LastCell.CellFormat.Borders.Right.LineStyle = LineStyle.Single

headerTable.Rows(4).LastCell.CellFormat.Borders.Right.Color = Color.Black

headerTable.Rows(4).LastCell.CellFormat.Borders.Right.LineWidth = 2.25

Hope this helps.

Best regards.