Share via

Cell border problems when spacing is on

Anonymous
2011-06-27T09:40:30+00:00

Hello

I have posted a problem here: http://social.msdn.microsoft.com/Forums/en-US/worddev/thread/09568dc3-59e2-4b1b-a142-69137efbf713

It applies to all versions up to 2007. I don't have 2010 to test.

I have a table for which Table.Spacing is on (default 0.04 inches, 2.8 points).

Because table spacing is on, each cell now has its own independent (un-collapsed) set of borders.

I am trying to format the borders for each of these separate cells in the table. 

For example,  I have created a table in Microsoft Word 2007. It is uniform. It is 2 x 2 (i.e. four cells).  Table spacing is on (default 0.04 inches, 2.8 points).  I set, for example, the top right hand cell borders to red line 3pt.  

It works, the first time, using the borders and shading dialog, applying to Cell.

However, if you then revisit the the borders and shading dialog, particularly if you look at the shading tab, the cell loses one or more of the red borders (usually the top border).  I.e. by simply re-opening the dialog, I lose borders!  Worse, I cannot then re-set them, without re-setting the whole table.

You cannot even read the borders using VBA.  I.e. Cells(1).Borders does not work properly when Table.Spacing > 0.

I am convinced this is a long-standing bug with Word, and have reported it.

I think this is because Word's programmers forgot about this scenario, so that Word behaves as if Table.Spacing were 0, and adjacent borders were merged. 

Has anyone any thoughts on this.

Julian

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Stefan Blom 342.4K Reputation points MVP Volunteer Moderator
2011-06-30T12:32:42+00:00

I can reproduce most of what you describe, in Word 2007. The previews are definitely broken, but I have to click OK in order for the "damaged" borders to actually be applied to the cell(s).

Was this answer helpful?

0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-07-01T14:32:00+00:00

    Interestingly, taking my example table, if I remove the border from the bottom right hand cell (so it has no border), then the left and right and borders of that cell extend too far upwards.  Clearly there are a few niggling bugs when table spacing is on.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-07-01T14:06:43+00:00

    I take your point about clicking OK.  I hadn't spotted that.   Thank you.

    I guess there is nothing more to add, as I think that this has been a long standing bug.  I don't know if 2010 is any different; but I know Microsoft ruthlessly priorities develoer time, so I don't expect it will be a priority, even if they do notice it.

    What drove my interest in the first place was that I was using VBA to try to read the red borders for the example cell, using the Borders collection. 

    Probably for the same underlying reason as the broken preview, Word's object model is broken here too. You get strange values in VBA for the same borders as those missing in the broken preview.

    I think the reason is about how word stores borders internally.  In a collapsed scenario, I guess a cell does not need to specify all its borders, as it will be supplied by the table edge or an adacent cell.  The programmers probably never thought people would use tables with spacing between cells that much, and so did not see any priority to fully test or complete this part of the picture.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-06-30T11:39:05+00:00

    Hi, thanks for your reply.

    The key is spacing between cells.

    1.   Create a 4x4 table.

    2.   Open the Table Properties dialog box.

    3.   Click on "Options..."

    4.   Tick the "Allow spacing between cells" check box, and set it to 0.4cm so that it is clear.

    5.   Go back to your table, and you will see that each cell is now separated, and has its own 4 borders.

    6.    Select the top right hand cell/

    7.    Open the borders and shading dialog, and apply a 2 1/4 pt red border to the cell.

    8.    Close the dialog, and the border is applied.  All is fine up to this point.

    9     Select the cell again, and re-open the borders and shading dialog. 

    10.  Immediately you will see that some of the borders are missing in the preview.  Do nothing, and just "Cancel" the dialog.

    11.  You should see the top border now reset in the selected Cell (event though you did nothing).

    Aside

    12.   If you then select the bottom right hand cell, and go to the borders and dialog box, you will see the missing top red border, and if you Cancel it is applied to the bottom right hand cell!

    Regards

    Julian

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-06-28T07:08:49+00:00

    How were you trying to insert the colors to the cell borders so that we can reproduce the issue?

    We inserted 2x2 table, changed the height to 0.04” and width to 2.8”, used table borders option to insert borders to single cell and were able to provide different color to different cells by opening the borders and shading option multiple times.

    Was this answer helpful?

    0 comments No comments