View Single Post
 
Old 04-10-2021, 11:47 AM
brent chadwick brent chadwick is offline Windows 8 Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 86
brent chadwick is on a distinguished road
Default Protect form fields when updating

Hey Guys, I've been using this macro for many years to protect form fields when updating them-until now. Suddenly in 365 this macro does not work. It does not select all the text in the doc, nor does it update the fields. Has there been a change in the VBA code language? Here's the macro-


Code:
Sub UpdateAllFields()
' UpdateAllFields Macro
 If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End If
If ActiveDocument.ProtectionType <> wdNoProtection Then
    ActiveDocument.Fields.Update
    ActiveDocument.Unprotect
   End If
End Sub
Thanks-
Reply With Quote