AllowPageBreaks setting forgotten in Word 2003

B

Brian Nixon

Try this:

Create a table with at least two rows near the bottom of a page, such that
the table spans the page break.

Then run this macro:

Sub SetTableProps()
Selection.Tables(1).AllowPageBreaks = False
End Sub

The table is no longer split across the page break. Fine.

Now save the document, close it, and open it again.

AllowPageBreaks is now True, and the table is split across the page break
again!

Am I doing something wrong, or is this a bug?

Cheers,

Brian
 
C

Cooz

Hi Brian,

Try this one:

Sub SetTableProps()
Selection.Tables(1).Rows.AllowBreakAcrossPages = False
End Sub

Good luck,
Cooz
 
B

Brian Nixon

Cooz said:
Try this one:

Sub SetTableProps()
Selection.Tables(1).Rows.AllowBreakAcrossPages = False
End Sub


That stops page breaks being inserted _within_ rows but not _between_
them. It corresponds to the option in the "Table Properties" dialog
box -> "Rows" tab -> "Options" section -> "Allow row to break across
pages" setting. It does survive the document being closed and
reopened, though.

Interestingly, there is no option in the dialog box that corresponds
to the Table.AllowPageBreaks property. Maybe that's why it's not
saved with the document?

I can achieve the effect I want by using your suggestion *and*
applying "Keep with next" to all the paragraphs in the table (except
those in the last row). It's not ideal, though.

I still think the lack of persistence of Table.AllowPageBreaks is a
bug. Is there a way to report things like this to Microsoft?

Cheers,

Brian
 

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