Preventing page break in table

B

Branaugh

I have a table that I would like to prevent from spanning across pages. I
created the following macro.

Dim aTable As Table
For Each aTable In ActiveDocument.Tables
aTable.Select
aTable.AllowPageBreaks = False
Next aTable

This works when the document is open, but if you save the document and
open it again, the table is once again spanning multiple pages.

Any thoughts or ideas.
Thanks
Bob Branaugh
 
Z

zkid

A bit confused here. If the table is spanning multiple pages, then doesn't
it NEED to flow? Are you referring to keeping each ROW from splitting across
a page but letting the table continue on as needed?

If so, then try this: aTable.Rows.AllowBreakAcrossPages = False
 
B

Branaugh

Just a point of clarification, I do not want the table to break across pages.
It is a short table that can and must fit on a single page.
 
Z

zkid

Then, there must be some hidden codes or something that is causing it to
break across the page. If it doesn't contain any confidential information,
I'd be happy to take a look at it for you. If so, send it to (collapse the
spaces, and reverse it, of course) c o x . n e t @ z i v d
 
J

Jonathan West

Branaugh said:
I have a table that I would like to prevent from spanning across pages. I
created the following macro.

Dim aTable As Table
For Each aTable In ActiveDocument.Tables
aTable.Select
aTable.AllowPageBreaks = False
Next aTable

This works when the document is open, but if you save the document and
open it again, the table is once again spanning multiple pages.

Any thoughts or ideas.
Thanks
Bob Branaugh

Set the KeepWithNext property of every paragraph within the table to be
True.
 

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