Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
Murray Anderson Murray Anderson is offline
external usenet poster
 
Posts: 3
Default Borders with Heading Rows Repeat

We have a corporate format for tables that has an outside border round the
whole table, an outside border round the heading row, vertical lines between
columns, but NO horizontal lines in the main body of the table. If the table
spills onto more than one page, we used "Heading Rows Repeat". Tables are
formatted not to allow page breaks within a row, so automatic breaks always
appear at a border between cells.

The problem is that, while this repeats the heading row (including its
outline border) on each subsequent page, it does not insert a bottom border
on the previous page. The result is that multiple-page tables are left
"hanging" unless a bottom border is inserted manually. Re-pagination is then
problematic. Is there a simple way of automatically generating a bottom
border in a cell before an automatic page break?
  #2   Report Post  
Posted to microsoft.public.word.tables
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Borders with Heading Rows Repeat

I dont think there is a simple manual way to do what you want.

However, it is possible to have all pairs of adjoining table cells checked
by a macro. If the cells are on different pages, a border must be added to
the first cell (which will be the last cell on a page). If the cells are on
the same page and if the first cell has a bottom border (e.g. because it was
previously the last cell on a page), the border must be removed.

Below you will find a macro that runs through all tables in the active
document and performs the changes described above (you may need to adjust the
border settings in the macro). A message appears when finished. I have made a
test on my computer on a document with 100 table rows €“ duration 4 seconds
(the more rows, the longer time).

Sub CorrectTableBorders()
Dim oTable As Table
Dim oRow As Row

Application.StatusBar = "Correction table borders. Please wait..."
System.Cursor = wdCursorWait
For Each oTable In ActiveDocument.Tables
For Each oRow In oTable.Rows
'Check all pairs of rows - not row 1
If oRow.Index 1 And oRow.Index oTable.Rows.Count Then
If oRow.Range.Information(wdActiveEndPageNumber) _
oRow.Range.Next.Information(wdActiveEndPageNumber) Then
'oRow is before page break - insert border below oRow
'REPLACE the line width, style and color as needed
With oRow.Borders(wdBorderBottom)
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
Else
'Remove bottom border if found
If oRow.Borders(wdBorderBottom).LineStyle
wdLineStyleNone Then
oRow.Borders(wdBorderBottom).LineStyle =
wdLineStyleNone
End If
End If
End If
Next oRow
Next oTable
System.Cursor = wdCursorNormal
Application.StatusBar = ""
MsgBox "Finished correcting table borders."
End Sub

--
Regards
Lene Fredborg
DocTools €“ Denmark
www.thedoctools.com
Document automation €“ add-ins, macros and templates for Microsoft Word


"Murray Anderson" wrote:

We have a corporate format for tables that has an outside border round the
whole table, an outside border round the heading row, vertical lines between
columns, but NO horizontal lines in the main body of the table. If the table
spills onto more than one page, we used "Heading Rows Repeat". Tables are
formatted not to allow page breaks within a row, so automatic breaks always
appear at a border between cells.

The problem is that, while this repeats the heading row (including its
outline border) on each subsequent page, it does not insert a bottom border
on the previous page. The result is that multiple-page tables are left
"hanging" unless a bottom border is inserted manually. Re-pagination is then
problematic. Is there a simple way of automatically generating a bottom
border in a cell before an automatic page break?

  #3   Report Post  
Posted to microsoft.public.word.tables
Disgusted Disgusted is offline
external usenet poster
 
Posts: 2
Default Borders with Heading Rows Repeat

I have verticle lines in my document which I cannot deleate. I never placed
them there. If I get rid of them all the formating in my document goes. This
has only happened using 2007. I find 2007 too complicated when the object of
computing is simplicity.

"Lene Fredborg" wrote:

I dont think there is a simple manual way to do what you want.

However, it is possible to have all pairs of adjoining table cells checked
by a macro. If the cells are on different pages, a border must be added to
the first cell (which will be the last cell on a page). If the cells are on
the same page and if the first cell has a bottom border (e.g. because it was
previously the last cell on a page), the border must be removed.

Below you will find a macro that runs through all tables in the active
document and performs the changes described above (you may need to adjust the
border settings in the macro). A message appears when finished. I have made a
test on my computer on a document with 100 table rows €“ duration 4 seconds
(the more rows, the longer time).

Sub CorrectTableBorders()
Dim oTable As Table
Dim oRow As Row

Application.StatusBar = "Correction table borders. Please wait..."
System.Cursor = wdCursorWait
For Each oTable In ActiveDocument.Tables
For Each oRow In oTable.Rows
'Check all pairs of rows - not row 1
If oRow.Index 1 And oRow.Index oTable.Rows.Count Then
If oRow.Range.Information(wdActiveEndPageNumber) _
oRow.Range.Next.Information(wdActiveEndPageNumber) Then
'oRow is before page break - insert border below oRow
'REPLACE the line width, style and color as needed
With oRow.Borders(wdBorderBottom)
.LineStyle = Options.DefaultBorderLineStyle
.LineWidth = Options.DefaultBorderLineWidth
.Color = Options.DefaultBorderColor
End With
Else
'Remove bottom border if found
If oRow.Borders(wdBorderBottom).LineStyle
wdLineStyleNone Then
oRow.Borders(wdBorderBottom).LineStyle =
wdLineStyleNone
End If
End If
End If
Next oRow
Next oTable
System.Cursor = wdCursorNormal
Application.StatusBar = ""
MsgBox "Finished correcting table borders."
End Sub

--
Regards
Lene Fredborg
DocTools €“ Denmark
www.thedoctools.com
Document automation €“ add-ins, macros and templates for Microsoft Word


"Murray Anderson" wrote:

We have a corporate format for tables that has an outside border round the
whole table, an outside border round the heading row, vertical lines between
columns, but NO horizontal lines in the main body of the table. If the table
spills onto more than one page, we used "Heading Rows Repeat". Tables are
formatted not to allow page breaks within a row, so automatic breaks always
appear at a border between cells.

The problem is that, while this repeats the heading row (including its
outline border) on each subsequent page, it does not insert a bottom border
on the previous page. The result is that multiple-page tables are left
"hanging" unless a bottom border is inserted manually. Re-pagination is then
problematic. Is there a simple way of automatically generating a bottom
border in a cell before an automatic page break?

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables - Heading Rows DON'T repeat Anne Parker Tables 1 September 7th 06 01:37 AM
Numbering of headings starting at Heading 2 Kamilla Winther Page Layout 3 March 27th 06 09:42 AM
repeat heading rows in table gailw Tables 1 March 23rd 06 05:15 PM
Table Heading Rows Repeat Pauline Tables 2 December 30th 05 03:21 AM
Tables - Heading Rows Repeat Over Sections Chris Beneteau Page Layout 2 October 11th 05 07:10 PM


All times are GMT +1. The time now is 08:56 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"