'Can macros be used to change properties of ActiveX Controls in Word?

I have a worksheet with multiple fillable fields (ActiveX Controls-- text, drop-down, dates, etc.) and essentially want the form to go to two parties. The first party will fill in a majority of the fields. Then I want to change the property of the controls to lock the content for editing, so when sent to the second party, they can only answer the remaining 'open' fields.

I recorded a macro changing the property of each ActiveX Controls so that when the form is ready to share, the first user would not have to manually change 30 something fields before sending the document to the second party.

When I run the macro I get an error: "Run-time error '91': Object variable or With block variable not set"

Can you record macros to change the property of ActiveX Controls in Word, and if so, what am I doing wrong? Thanks in advance for helping!

'
' RestrictActiveXControls Macro
' Restrict editing on all ActiveX Developer Controls in the Standardized MAFES Hay Form.
'
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
    Selection.ParentContentControl.LockContents = True
End Sub```


Solution 1:[1]

I do not have the reputation needed to comment (and so I can only respnd to your comments by changing this post), but...

...If you are using ActiveX Controls, the code you have will not work because it references Content Controls - for example, you have

Selection.ParentContentControl.LockContents = True

(i.e. the wrong type of control)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DidMyBest