Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Tables - Heading Rows DON'T repeat | Tables | |||
Numbering of headings starting at Heading 2 | Page Layout | |||
repeat heading rows in table | Tables | |||
Table Heading Rows Repeat | Tables | |||
Tables - Heading Rows Repeat Over Sections | Page Layout |