Hi,
I am creating a macro to disable certain sections of a document (document has a lot of content controls and thus have to disable them aswell).
After running this macro, my doc is still not protected. Any idea what I'm doing wrong? Below is the code.
Code:
Sub DisableDoc()
'locking the content controls
Dim ofmfld As FormField, CCtrl As ContentControl
With ActiveDocument
For Each ofmfld In .FormFields
ofmfld.Enabled = False
Next
For Each CCtrl In .ContentControls
CCtrl.LockContentControl = False
Next
End With
Selection.InsertBreak Type:=wdSectionBreakContinuous
ActiveDocument.Sections(1).ProtectedForForms = False
ActiveDocument.Sections(2).ProtectedForForms = True
ActiveDocument.Sections(3).ProtectedForForms = True
ActiveDocument.Sections(4).ProtectedForForms = True
ActiveDocument.Sections(5).ProtectedForForms = True
ActiveDocument.Sections(6).ProtectedForForms = True
End Sub