Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add lines to a protected form in Word 2000

Status
Not open for further replies.

swaggel1

Technical User
Jun 19, 2001
34
US
We have created a variety of forms using MS Word 2000. Certain of these forms are created based on tables in which each row is a separate data entry. We use form fields to allow data entry while the form is protected. One of the problems we have is that we may create a form allowing for the entry of 10 records, for example, but a user may have the need to input 25 records. Is there a way to create a form based on a table with 10 entry lines, protect the form, but still allow users to add additional lines if necessary? We would prefer to create the forms in the smallest format possible and allow the user to create more entry rows, rather than to create extra-large forms with numerous entry rows. We have been unable to include this functionality in a protected document. Thanks!
 
The one thing that I have done using simple Word 2000 capabilities in similar forms is to create an unprotected section around the cell to which you want users to be able to add rows. This works fairly well, but users will need to use their mouse to click out of this section since tabbing will continue inserting empty cells.

 
I am not very familiar with VBA, but I have faked my way through some basic coding in MS Access. I could probably give it a shot if I had some direction on what I need to do.
 
Specific code to unprotect/reprotect without losing what's been filled in already. Users of Word XP don't need this.

Before other code:
ActiveDocument.Unprotect Password:=""

After other code:
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""

PERHAPS (you'll need to test this out) you can record the insertion of XX table rows. Then, in the form field properties of last formfield in your table, do an on-exit macro that unprotects/inserts rows/reprotects.

Problems I ran into and don't recall how they were resolved:

1. How many rows? Just one?
2. If you copy an existing, completed row and paste it, it maintains the populated fields; see if you can create an autotext that will create the row.
3. If you can't manage the on-exit macro, try a macro button on a floating toolbar. Build the toolbar in your code or you may run into trouble sending it to others to use. Before you end your code, close the toolbar or it will come up and stay up. Here's some sample code for that:

Let me know if you need more help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top