none
Cell Border Problems RRS feed

  • Question

  • Hi

    I am currently writing a program to convert word documents to HTML with better accuracy and cleaner HTML than the built in word converter.

    As part of my testing, I have encountered what I think is a problem (a bug in my view) with table cell borders, when the table cell spacing is on.

    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 the top right hand cell borders to red line 3pt.  

    Two problems:-

    1.   If you then go to the shading tab of the borders and shading dialog, 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!

    2.   If you have spacing set to on, then you cannot read the borders using VBA.   I.e. if I set all 4 borders to red then:-

    Debug.Print Selection.Range.Cells(1).Range.Borders(wdBorderLeft).Color
    255

    Debug.Print Selection.Range.Cells(1).Range.Borders(wdBorderRight).Color
    -16777216

    In short, Word 2007 cell borders (with Spacing > 0) are a mess.

    Any one else encountered this?

    Julian

     

     

     

     

     

     

     

     

    Friday, June 24, 2011 11:09 PM

All replies