Partager via


ContentControl.Delete Method (Word)

Deletes the specified content control and the contents of the content control.

Syntax

expression .Delete(DeleteContents)

expression An expression that returns a ContentControl object.

Parameters

Name

Required/Optional

Data Type

Description

DeleteContents

Optional

Boolean

Specifies whether to delete the contents of the content control. True removes both the content control and its contents. False removes the control but leaves the contents of the content control in the active document. The default value is False.

Example

The following example removes all content controls and their contents from the active document.

Dim objCC As ContentControl 
 
Do While ActiveDocument.ContentControls.Count > 0 
 For Each objCC In ActiveDocument.ContentControls 
 objCC.Delete True 
 Next 
Loop

See Also

Concepts

ContentControl Object

ContentControl Object Members