If you want a border on the top of every paragraph, use the horizontal border, which displays between paragraphs. If you set the top border, it appears only on the first paragraph in the table cell.
BORDER IN MICROSOFT WORD 2010 PLUS
There are 5 borders: top, right, bottom, left plus horizontal borders. For example ActiveDocument.Styles("MyTableStyle").ParagraphFormat.Borders. This property controls the borders of text within a table cell.Ī Table style has a. Shadow setting, because it has unintended consequences. So you can't just 'on error resume next' your way past the. And, when that happens, Word sets the first 6 borders (ie top, right, bottom, left, vertical and horizontal, but not diagonal) of the table to black, single line borders. It does not produce an error, but it makes no difference, either. Setting distance from top (eg = 5) never works. Their default is wdUndefined, and they always report wdUndefined, so you can't rely on the reported value. Both properties always return wdUndefined, even when the border is visible. You can't read the colour or width of a diagonal border.Diagonal borders always show as black, regardless of what colour you set.You can't set a width on diagonal borders.Diagonal borders always display as wdLineStyleSingle no matter what line style you set.Diagonal bordersĭiagonal borders are basically uncontrollable: These borders generally work as expected. Top, right, bottom, left, horizontal and vertical borders This applies whether the condition's border is set before or after the border. That makes sense, because the specific is over-riding the general. So, for example, if the first column condition has a left border, then you won't see the whole-of-table border. Table will be overriden by, eg, (n).Border(m). There are 8 borders: top, right, bottom, left, horizontal, vertical and two diagonals.Īny border on the style's. For example, ActiveDocument.Styles("MyTableStyle").Table.Borders. It doesn't work for a table style, and returns error "That property is not available on that object". How borders behave for different elements of table styles Style.Borders Can't set distance between border and text. May have unintended consequences (eg setting a border in the top row will turn off the display of the Total Row, Last Column and Banded Columns). Can't control distance between border and text.
![border in microsoft word 2010 border in microsoft word 2010](https://www.thewindowsclub.com/wp-content/uploads/2021/01/DuckDuckGo-All-Sizes.jpg)
Can't control diagonal borders, distance between border and text or shadows.ĭodgy. Word says "That property is not available on that object" Summary Item in the Word object modelĭoes not work.
![border in microsoft word 2010 border in microsoft word 2010](https://sccaid.com/wp-content/uploads/2021/02/TMNW-cach-tao-xoa-khung-vien-word-2007-2010-2013-1.jpg)
Certainly don't try to set the properties of Table Normal.
BORDER IN MICROSOFT WORD 2010 CODE
Avoid trying to read its properties, and if you do, litter your code with error catching. In general, my experience is that it's best to leave style Table Normal alone.
![border in microsoft word 2010 border in microsoft word 2010](https://static.javatpoint.com/msword/images/how-to-add-a-border-in-word21.png)
In addition, the built-in style Table Normal has its own rules, often different from the way any other table style, built-in or custom, behaves. Sometimes can you set a shadow on the borders, and sometimes you can't.Sometimes you can set the distance between the borders and the text, and sometimes you can't.Borders property can have 1, 4, 5 or 8 borders, some of which you can control, and some of which you can't. The issues for table styles are the same as those for non-table styles: So what's the problem with borders and table styles?įor basics of controlling borders in styles, see Border basics for developers. This page describes my experiences with borders in table styles.
![border in microsoft word 2010 border in microsoft word 2010](https://www.addictivetips.com/app/uploads/2018/08/border-color-tool-word.jpg)
My experience is that some of them work and some don't. There are 7 different objects that manage borders in a table style. Microsoft introduced table styles in Word 2002.