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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locking information/text in a Word document

Status
Not open for further replies.

Warlocks

Technical User
Jan 9, 2003
79
GB
Hi,

I am wanting to create a template in Word and then lock the page so that only areas that are to be typed in are allowed to be altered.
For instance, one document I am creating is a template for a purchase order. It will have a border around the outside (currently drawn on... other ideas welcome!!) and also a line to separate the header section from the area in which to type.
There is also a company logo (tif image) to be inserted into the header.

The problem is that I have created the document how I want it to look and even saved as a template so that when opening, it opens a blank document using the template. The snag is that if the user accidentally clicks and drags on the page or image, the drawn objects (logo and/or border) are dragged and the page is ruined. Also, the user is able to format the existing text...

Is there anyway I can lock the document and also indicate areas on the page where users can fill in the necessary text?

Thanks,

Woody.
 
Use section breaks. Most likely you will need a combination of Continous section breaks, and Page Section Breaks. A Continous section break is simply that - it makes a break at the character level. The important point being that you can "lock", or protect sections.

Put the section breaks where you need them, and protect the sections you do not want users to change. Tools | Protect Document, then select Forms. Then select the sections to protect. The ones that are checked are "locked", ones unchecked are open for users to do whatever.



Gerry
 
For a purchase order, where you will be entering details in a table, use Excel. I find it a lot easier to protect different parts of a form in Excel than in Word. Easier to use Excel formulae to calculate your discounts, totals & tax as well.
 
You can do some serious calculations within fields in Word. Although I agree if you are doing seriously complex manipulations, Excel would be better.

However, Word has ample ability to handle forms, and lock out whatever portions you need to lock. You can restrict and user input to whatever you want to restrict them to.

It also can do logical operations between fields. That is, a user could make an entry in a field and other fields will react and determine logical results from it.



Gerry
 
Hey Fumei,

Could you please elaborate a bit? I think the question is being asked "is there any way to...
 
Hi,

Bankboysb is right. I am not so much interested in the calculations in Word but more with being able to create a document whereby I can limit the changes that are made to a document to prevent users inadvertantly moving objects around the screen by mistake and ruining the look of the form.
Although the calculations in Word now begin to intrigue me for the Totals column...

Woody.

PS: Good old bankboysb who has managed to start a debate that I failed to do so bank in March... and with just one word!!!
 
OK, but please look up Help or some other references to the use of formfields. There is no way I can get into serious detail here - for one thing I do not have a good idea of what your needs are. And the only way to get that is see your document. If you want, you can send a copy to me and I can comment.

That being said...here goes.

SCENARIO 1

It depends on your requirements. The basic one is: do your users need to be able to change anything at all? Not taking about input, but changes to the document itself.

Depending on what you need, you can lock portions of a document by using section breaks. (Insert|Break). There are a number of break types. If you are doing breaks within a page, then you use Continuous breaks. For example:

text text text text text text text text text
"Please check the items you wish to purchase, and the quantity."
* ** *** section break * * * **
(Checkbox) "Ice cubes" "Quantity" (DropDown)
(Checkbox) "Polar bears" "Quantity" (DropDown)
(Checkbox) "Bengal tigers "Quantity" (DropDown)

* ** *** section break * * * **

The checkboxes are checkboxes - either checked or unchecked.
The dropdowns can contain whatever you want. Although I can not see having more than 1 to 5 on the tigers, but maybe 1 to 4,000 on the ice cubes??

All text between the section breaks (once protected) can not be altered by the users. They can check the boxes, choose a dropdown, but that is it.

Uh, that is assuming you have put a password on the "Protect document", and the user does not know it.

So, you protect your areas and text that you do not want users to change. These areas do NOT have to contain a formfield.

* ** *** start of protected section * * * **
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
text text text text text text text text text
* ** *** end of protected section * * * **

The above text will not be editable.

Note however, that user input via formfields requires protected sections. Dropdowns will not work unless the section they are in is protected.

SCENARIO 2

Lock the whole document. Do all user input with a VBA UserForm. Pick up all the data from there. Do all your error trapping there ( Message: "Sorry, but we can not accept 34 qbkjf78s;mn Street as a valid address"). When done, drop all the data into the document. Say a textbox control on the UserForm is called txtLastName. On user clicking OK, you take the value of that textbox control and dump it into the document as either a) a bookmark value, or b) a formfield value, or c) a document variable

This is now what I also mentioned: logic between fields.

This can be done using formfields themselves, OR, using a UserForm.

Say the tiger dropdown is named QuantityTigers You could have the following happen - just because QuantityTigers is greater than 0. If blank...then nothing happens.

1. Have Word create another document, with boilerplate information on the care and feeding of tigers.
2. Open another document that covers the insurance liabilities of actually owning a Bengal tiger.
3. Insert into that document, the number of tigers (from QuantityTigers) , calculates the cost per tiger (if greater than 1), adds shipping.
4. sends the documents off to the idiot buying tigers.

with all of this either invisible to the user (screen updating is false); or with documents that are protected. These document could be filled in automatically, with a final message OK allowing the user to scan through the document for correctness, and if OK - on OK the document is locked, saved and gone.

Sorry all. again too much coffee, not enough sleep.

What I am saying is: better user specs = better software.

What do you NEED?


Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top