
Running a macro to add a row in a table
Hi Peter,
Quote:
> Users will enter data in the respective row (possibly in fields) and when
> they get to the end of that row another one is added to the bottom of the
> table. This last bit is done under normal circumstances, but I can't seem
> to get to grips with doing this when the document is protected as a form,
> unless I use fields across the row (15 in all) and have a macro run on
> exiting the last field.
This is the way you have to go, so you're on the right track :-)
Quote:
> My difficulty is getting the values of the fields in the first row to stay
> put! If I unprotect, add a row and protect it again I lose all the data in
> the rows above the added one.
Take a close look in the Word
VBA Help at the .Protect method. There's an
argument in there - .NoReset - you need to set this to "True" to keep the
field content from resetting to its default.
A tip: if you're table rows need special formatting or content (sets of named
form fields, for example), it sometimes works to save the row as an AutoText
entry, and insert that. Save you a lot of coding :-)
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)