ContentControl.LockContentControl Property

Word Developer Reference

Returns or sets a Boolean that represents whether the user can delete a content control from the active document. Read/write.

Syntax

expression.LockContentControl

expression   An expression that returns a ContentControl object.

Remarks

The default value of this property is False. This property corresponds to the Content control cannot be deleted check box in the Content Control Properties dialog box.

Bb242775.vs_note(en-us,office.12).gif  Note
You cannot set this property if the Temporary property is set to True.

Example

The following example inserts a date content control into the active document, and then sets the contents of the content control and specifies that the user cannot edit the contents or delete the control from the document.

Visual Basic for Applications
  Dim objCC As ContentControl

Set objCC = ActiveDocument.ContentControls _ .Add(wdContentControlDate)

objCC.Range.Text = "January 1, 2007" objCC.LockContents = True objCC.LockContentControl = True

See Also