View Single Post
 
Old 08-20-2020, 11:33 AM
GDixit GDixit is offline Windows 10 Office 2010
Novice
 
Join Date: Aug 2020
Posts: 2
GDixit is on a distinguished road
Default I could develop macro for my requirements

Sub Protect_Form_Fields_2()
'
' Protect_Form_Fields_2 Macro
'
'
Dim i As Long
Dim startPos As Integer
Dim endPos As Integer

With ActiveDocument
For i = 1 To .ContentControls.Count
Set ContentControl = .ContentControls(i)
startPos = ContentControl.Range.Start - 1
endPos = ContentControl.Range.End + 1
Application.ActiveDocument.Range(startPos, endPos).Editors.Add WdEditorType.wdEditorEveryone

Next i
.Protect Password:="NoChange", NoReset:=False, Type:= _
wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False
End With
End Sub
Reply With Quote