MS Word Table Fit On Page

V

vbnetdev

Is there a way to force a MS Word table to make it and its contents appear
on a single page regardless of what happens ot the data inside? Using vba on
Office 2000. I am pasting excel charts into the table and trying to make it
all fit on one page.
 
J

Jonathan West

vbnetdev said:
Is there a way to force a MS Word table to make it and its contents appear
on a single page regardless of what happens ot the data inside? Using vba
on Office 2000. I am pasting excel charts into the table and trying to
make it all fit on one page.


If what you want to do is make sure that a table smaller than a page will
always start on the next page rather than allow a page break to occur in the
middle because the table starts near the bottom, then set the
ParagraphFormat.KeepWithNext property of the table's Range to True.

If you want to squeeze a table onto one page that is larger than a page,
then you have to reduce the font size of the text until it all fits.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
V

vbnetdev

Is there a way to detect if two pages exist in vba in Word? What I am
thinking is if I check that then I go in and reduce the size of the chart
until I get it on one page....
 
J

Jonathan West

vbnetdev said:
Is there a way to detect if two pages exist in vba in Word? What I am
thinking is if I check that then I go in and reduce the size of the chart
until I get it on one page....

Yes. Look up the Information property. One of the options there returns the
page number of the active end of the range or selection. So you would
proceed as follows

1. Insert the table
2. repaginate the document
3. get the page numbers of the start & end of the document.
4. If the same, exit.
5. Shrink the table a bit
6. go to #2


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top