Macro to change table settings

S

Sesquipedalian Sam

I am trying to write a macro to change the table settings so that:

1. Automatically resize to fit = Off.
2. Rows are not allowed to break across pages.

I started by recording the steps and got this:

With Selection.Tables(1)
.AllowPageBreaks = False
.AllowAutoFit = False
End With

The autofit setting works. The pagebreaks does not.

Do I need to loop through the rows one at a time?
 
S

Suzanne S. Barnhill

You'll need a macro to turn resizing off, but the row-breaking setting is
one of those that you can specify in a table style.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
S

Sesquipedalian Sam

You'll need a macro to turn resizing off, but the row-breaking setting is
one of those that you can specify in a table style.

This macro code seems to work:

Selection.Tables(1).Select
Selection.Rows.AllowBreakAcrossPages = False
Selection.Tables(1).AllowAutoFit = False

Since I need to write a macro anyway, I'll put it all in there.
 

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