Quote:
Originally Posted by rpb925
Is it the borders code that is inconsistent. I would like to make the code as good as possible.
|
Well, since you've set them all to 'none', I can't imagine what they're not consistent with.
That said, you could replace all of:
Code:
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.ApplyStyleRowBands = True
.ApplyStyleColumnBands = False
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
with:
Code:
.Borders.Enable = False
Quote:
Originally Posted by rpb925
Not sure what you mean by inconsistent.
|
Well, the following hardly follows a decent visual structure:
Code:
With wdTbl
...
With .Columns(1)
.PreferredWidthType = wdPreferredWidthPoints
.PreferredWidth = CentimetersToPoints(3)
End With
With .Columns(2)
.PreferredWidthType = wdPreferredWidthPoints
.PreferredWidth = CentimetersToPoints(13)
End With
Visually, it gives the impression the first 'End With' related to 'With wdTbl', which it doesn't and that 'With .Columns(2)' ... 'End With' is outside the 'With wdTbl' ... 'End With' structure. Consider also Greg's comments about your code in this thread:
https://www.msofficeforums.com/word-...ated-word.html