If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|