View Single Post
 
Old 03-28-2016, 03:26 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,478
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by rpb925 View Post
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 View Post
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
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote