Dennis's document has quite a few fields in it. Most of the time he keeps the fields locked so that they don't update. (There are enough fields that updating them all can cause a noticeable delay.) Dennis wonders if there is a way to select a subset of fields, such as DATE or REF, and unlock just that subset in one go?
Document fields can be either locked or unlocked. If they are unlocked, then they are updated as normal, providing the dynamic content that most people want. (When you insert a field, it is unlocked, by default.) If a field is locked, then it is not updated automatically and simply returns whatever results was visible when the field was last locked.
There is no built-in way to selectively unlock fields in a document. Microsoft expects that you will lock or unlock fields one by one, or by selecting all the fields and you want to affect and then changing their lock status.
Fortunately, you can create a macro to do the unlocking. The following macro asks the user for the type of field to be unlocked, and then steps through the fields in the document to make the changes:
Sub UnlockSpecificFields()
Dim fld As Field
Dim fldCode As String
Dim fldType As String
Dim requestedType As String
Dim spacePos As Long
Dim fieldCount As Long
requestedType = InputBox( _
"Enter the field type you want to unlock " & _
"(for example, DATE, TIME, REF, or PAGE):", _
"Field Type")
requestedType = UCase(Trim(requestedType))
If requestedType > "" Then
fieldCount = 0
For Each fld In ActiveDocument.Fields
fldCode = UCase(Trim(fld.Code.Text))
'Get only the field type, which is the first
'word in the field code.
spacePos = InStr(fldCode, " ")
If spacePos > 0 Then
fldType = Left(fldCode, spacePos - 1)
Else
fldType = fldCode
End If
If fldType = requestedType Then
If fld.Locked Then
fld.Locked = False
fieldCount = fieldCount + 1
End If
End If
Next fld
MsgBox fieldCount & " " & requestedType & _
" field" & IIf(fieldCount < 2, " was", "s were") & _
" unlocked.", vbInformation, "Done"
End If
End Sub
The heart of the macro is where the .Locked property is set to False, which unlocks a field. Everything else in the macro is used to determine which fields to unlock and to make the proper comparison to each field within the document. When the macro is complete, it reports on how many fields were unlocked.
Note, as well, that this macro affects only those fields within the main body of the document. If you have fields in other places (such as footnotes, endnotes, and the like), nothing is done with those.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13994) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365.
Discover the Power of Microsoft Office This beginner-friendly guide reveals the expert tips and strategies you need to skyrocket your productivity and use Office 365 like a pro. Mastering software like Word, Excel, and PowerPoint is essential to be more efficient and advance your career. Simple lessons guide you through every step, providing the knowledge you need to get started. Check out Microsoft Office 365 For Beginners today!
Fields can be a great way of adding small snippets of dynamic data to your documents. However, you may want to get rid of ...
Discover MoreNeed to jump from one place in your document to another? One way to do this is through the user of the GotoButton field, ...
Discover MoreDo you want to keep track of when changes were made to your document? This tip looks at a couple of ways to do it, along ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2026-08-15 13:28:09
Vince Lord
I guess once they are unlocked and you close the document, the next time you open them they are still open. Haven’t tried that, but seems like another micro to reset them upon closing the document would be needed. Or is there a quick way?
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2026 Sharon Parq Associates, Inc.
Comments