Lock a table's size

S

Steve

I have a doc that several people in my group edit every day - each has their
own copy of it. The doc has a table that cannot be longer than a certain
size. Is there a way to lock the table's height so the users cannot add rows
or type text that wraps (making the table longer)? The table needs to be the
same size no matter how much text they put it.
 
J

Jeff Hall

The table needs to be the same size no matter how much text they put it.

Don't be silly... how do you expect Word to handle that?
You can fix a cell's width and set the row's height but if the content of
the cell exceeds the available space, Word has only one option - make the
cell longer in height.

The only suggestion I can give you is to use text boxes in place of cells.

--------------------------------------------------------------------
Jeff Hall MSc MRICS
Director, Eon Commerce Ltd.
http://www.eon-commerce.com

Software available for you to evaluate before buying...
EasyHTML/Help CHM file Editor for MS Word
http://www.easyhtmlhelp.com
 
S

Suzanne S. Barnhill

If you set an exact row height, Word will *not* make a cell bigger;
additional text will disappear. But stopping users from adding rows is more
problematic, unless the document is protected for forms.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jezebel

You can detect that the user has added a new row by catching the
WindowSelectionChange event: if you're in the last row of *that* table, and
the rowindex is greater than the 'correct' number of rows for that table,
then delete the row ...

OK in theory, but I wouldn't recommend it. Fairly complex to code, and
confusing as hell for the user.

A better approach would be to let the user do what they like, then validate
the document before using it for whatever purpose demands the fixed size
table.
 
C

Cindy M -WordMVP-

Hi Steve,
I have a doc that several people in my group edit every day - each has their
own copy of it. The doc has a table that cannot be longer than a certain
size. Is there a way to lock the table's height so the users cannot add rows
or type text that wraps (making the table longer)? The table needs to be the
same size no matter how much text they put it.
Well, Suzanne has told you how to set the row heights and column width to an
"exact" amount.

For the number of rows, you can use a macro named NextCell that does
absolutely nothing (or moves the selection to the beginning of the next
paragraph after the table) to stop the automatic creation of new rows.
Example:

Sub NextCell()
Dim rng As Word.Range

Set rng = Selection.Tables(1).Range
rng.Collapse wdCollapseEnd
rng.Select
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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