Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
cleo_cat cleo_cat is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.tables
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page view size on screen is larger than actual page size ozegirl Page Layout 1 March 29th 07 02:30 AM
How can table field stay fixed size and not expand to 2nd page? KLamm Tables 1 February 28th 07 07:37 AM
How do I reduce width of table of contents fit smaller page size? iain Page Layout 1 March 30th 06 02:43 AM
can i auto format my document from full page size to half size? Lisa Page Layout 1 March 28th 06 08:44 PM
Page size in setup doesn't match page size in page view absolutchristine Page Layout 1 October 6th 05 12:09 AM


All times are GMT +1. The time now is 03:24 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"