Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
Table that is Page Size
Word 2003: Is it possible to tell a table that you want it to be the size of
one page? I have a table that I want to be x # of rows long and y # columns wide. I want the table to fill the whole page and then I can click "evenly distribute rows," and "evenly distribute columns." However, I spend a lot of time trying to resize the table to one page and then, often, when I click, "evenly distribute rows," it bumps some of the rows over onto the next page. I keep having to guess how big the rows should be. Any ideas? Thank you in advance. |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
Table that is Page Size
Hi cleo_cat,
The following macro fits all tables in a document to the height of the page of the section in which they appear. Row heights are evenly distributed. Whether each table actually prints on a single page depends on whether there is anything else on the same pages. Sub TableFit() Application.ScreenUpdating = False Dim oTopMargin As Single, oBottomMargin As Single, oBottomLine As Single Dim oPageHeight As Single, oPrintHeight As Single, oRowHeight As Single Dim oTable, i As Integer If ActiveDocument.Tables.Count = 0 Then Exit Sub For i = 1 To ActiveDocument.Tables.Count oTable = ActiveDocument.Tables(i) oBottomLine = 0 For each oCell in oTable.Rows(1) For each oCell in oTable.Rows(oTable.Rows.Count) If .Borders(wdBorderBottom).LineWidth oBottomLine Then _ oBottomLine = .Borders(wdBorderBottom).LineWidth Next With oTable.PageSetup oTopMargin = .TopMargin oBottomMargin = .BottomMargin oPageHeight = .PageHeight End With oPrintHeight = oPageHeight - oTopMargin - oBottomMargin - oBottomLine /8 -1 oRowHeight = oPrintHeight / oTable.Rows.Count With oTable.Rows .Height = oRowHeight .HeightRule = wdRowHeightExactly End With Next Application.ScreenUpdating = True End Sub -- Cheers macropod [MVP - Microsoft Word] "cleo_cat" wrote in message ... Word 2003: Is it possible to tell a table that you want it to be the size of one page? I have a table that I want to be x # of rows long and y # columns wide. I want the table to fill the whole page and then I can click "evenly distribute rows," and "evenly distribute columns." However, I spend a lot of time trying to resize the table to one page and then, often, when I click, "evenly distribute rows," it bumps some of the rows over onto the next page. I keep having to guess how big the rows should be. Any ideas? Thank you in advance. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page view size on screen is larger than actual page size | Page Layout | |||
How can table field stay fixed size and not expand to 2nd page? | Tables | |||
How do I reduce width of table of contents fit smaller page size? | Page Layout | |||
can i auto format my document from full page size to half size? | Page Layout | |||
Page size in setup doesn't match page size in page view | Page Layout |