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

locking a field in word

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
hallo,

I have some fields in my document and I would like people not to modify them. I tried to use the Locked property, but the fields value can still be edited. Does someone knows how to do this? Thanks
 
I am using Word 2003.

Fields: you can insert them by choosing "insert" > "fields...". You have got a lot of predefined categories but you can also choose "DocVariables", that you can define.

You can define them in VBA:

ActiveDocument.Variables("myVariable")

There is also the property:
ActiveDocument.Variables("myVariable").locked

but this property won't prevent the user to be able to modify the field in the document.

 
You can lock a Field, not a Variable, and it probably does the opposite of what you want anyway; it doesn't protect against editing, it stops the document being updated from the variable not the other way round.

If you want to protect part of your document, protection, not locking, is what you need. Word 2003 allows you to protect parts of a document.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
I found a lot of material about protecting the whole document, but what about if I want to protect a single field?

Any hint? Thanks
 
On the Tools > Protect Document Task Pane, check the "Allow only this type of editing" check box in Section 2. Leave the dropdown at the default "No changes". Select the parts of the document you want unprotected and check "Everyone" under "Exceptions" (which will have appeared).

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Yes, Gerry, new in 2003, and you can make different exceptions for different users although I'm not sure how it defines or recognises the different users). The interface is a Task Pane instead of a dialogue and sits there beside your document so you can switch protection on and off and change aspects of it while you work. All in all, an improvement.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top