
Tips.Net > WordTips Home > Fields > Locating Locked Fields
Summary: A field can be locked or unlocked, and its condition controls whether it is updated automatically or not. If you want to search for only locked fields in a document, you’re going to need the macro presented in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
Fields are very useful when working with a document—they allow you to place "dynamic" information in your documents. Sometimes you may want a field to remain static; to not change. You can do this by selecting the field and press Ctrl+F11. This "locks" the field so it does not update from its current value.
If you have a lot of fields in a document, and some of them are locked, you may want a way to quickly find out which ones are locked. Word has no special feature that allows you to search for locked fields, but you can create a macro that will search them out for you. The following macro, FindLocked, starts at the beginning of a document and finds locked fields. It selects each locked field, in turn, and asks you if you want to continue searching.
Sub FindLocked()
Dim iField As Integer
Dim vResponse As Variant
For iField = 1 To ActiveDocument.Fields.Count
If ActiveDocument.Fields(iField).Locked Then
ActiveDocument.Fields(iField).Select
vResponse = MsgBox("Continue Searching?", vbYesNo)
If vResponse = vbNo Then Exit For
End If
Next iField
End Sub
Tip #1367 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Save Time! You can have this tip (and several hundred just like it) in the WordTips annual archives. Imagine having over 400 tips available at your fingertips, in each annual volume.
Word includes two powerful search engines. Do you know how to use them both? You can discover new knowledge with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips