共用方式為


ContentControl.LockContents Property

Gets or sets a value that specifies whether the contents of the ContentControl can be edited.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
Property LockContents As Boolean
bool LockContents { get; set; }

Property Value

Type: System.Boolean
true if the contents of the ContentControl cannot be edited; false if the contents of the control can be edited. The default is false.

Remarks

To prevent users from deleting a ContentControl from the document, use the LockContentControl property.

For more information about using a ContentControl to protect a part of a document, see Content Controls and How to: Protect Parts of Documents by Using Content Controls.

.NET Framework Security

See Also

Reference

ContentControl Interface

Microsoft.Office.Tools.Word Namespace

Other Resources

Content Controls

How to: Protect Parts of Documents by Using Content Controls