Class ContentControl (Word VBA)

An individual content control. Content controls are bounded and potentially labeled regions in a document that serve as containers for specific types of content. Individual content controls may contain contents such as dates, lists, or paragraphs of formatted text. The ContentControl object is a member of the ContentControls collection.

Class Range gives access to class ContentControl.


Dim ccl as ContentControl
Set ccl = ActiveDocument.Range.ContentControls(Index:=1)

For Each

Here is an example of processing the ContentControl items in a collection.


Dim ccl As ContentControl
For Each ccl In ActiveDocument.Range.ContentControls
	
Next ccl

Methods

Copy - Copies the content control from the active document to the Clipboard.

Cut - Removes the content control from the active document and moves the content control to the Clipboard.

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

SetCheckedSymbol - Sets the symbol used to represent the checked state of a check box content control.

SetPlaceholderText - Sets the placeholder text that displays in the content control until a user enters their own text.

SetUncheckedSymbol - Sets the symbol used to represent the unchecked state of a check box content control.

Ungroup - Removes a group content control from a document so that its child content controls are no longer nested and can be freely edited.

Properties

AllowInsertDeleteSection gets or sets whether users can add or remove sections from the specified repeating section content control by using the user interface.

Appearance returns or sets the appearance of the content control.

BuildingBlockCategory returns or sets a String that represents the category for a building block content control.

BuildingBlockType returns or sets a WdBuildingBlockTypes constant that represents they type of building block for a building block content control.

Checked returns or sets a Boolean that represents the current state (checked/unchecked) for a check box.

Color returns or sets the color of the content control.

DateCalendarType returns or sets a WdCalendarType constant that represents the calendar type for a calendar content control.

DateDisplayFormat returns or sets a String that represents the format in which dates are displayed.

DateDisplayLocale returns a WdLanguageID that represents the language format for the date displayed in a date content control.

DateStorageFormat returns or sets a WdContentControlDateStorageFormat that represents the format for storage and retrieval of dates when a date content control is bound to the XML data store of the active document.

DefaultTextStyle returns or sets a Variant that represents the name of the character style to use to format text in a text content control.

DropdownListEntries returns a ContentControlListEntries collection that represents the items in a drop-down list content control or in a combo box content control.

ID returns a String that represents the identification for a content control.

Level returns the level of the content control—whether the content control surrounds text, paragraphs, table cells, or table rows; or if it is inline.

LockContentControl returns or sets a Boolean that represents whether the user can delete a content control from the active document.

LockContents returns or sets a Boolean that represents whether the user can edit the contents of a content control.

MultiLine returns a Boolean that represents whether a text content control allows multiple lines of text.

ParentContentControl returns a ContentControl that represents the parent content control for a content control that is nested inside a rich-text control or group control.

PlaceholderText returns a BuildingBlock object that represents the placeholder text for a content control.

Range returns a Range that represents the contents of the content control in the active document.

RepeatingSectionItems returns the collection of repeating section items in the specified repeating section content control.

RepeatingSectionItemTitle returns or sets the name of the repeating section items used in the context menu associated with the specified repeating section content control.

ShowingPlaceholderText returns a Boolean that indicates whether the placeholder text for the content control is displayed.

Tag returns or sets a String that represents a value to identify a content control.

Temporary returns or sets a Boolean that represents whether to remove a content control from the active document when the user edits the contents of the control.

Title returns or sets a String that represents the title for a content control.

Type returns or sets a WdContentControlType that represents the type for a content control.

XMLMapping returns an XMLMapping object that represents the mapping of a content control to XML data in the data store of a document.

BuildingBlock - Represents a building block in a template. A building block is pre-built content, similar to autotext, that may contain text, images, and formatting.

ContentControlListEntries - The ContentControlListEntries collection contains ContentControlListEntry objects that represent the items in a drop-down list or combo box content control.

Range - Represents a contiguous area in a document. Each Range object is defined by a starting and ending character position.

RepeatingSectionItemColl - Represents the collection of RepeatingSectionItem objects.

XMLMapping - Represents the XML mapping on a ContentControl object between custom XML and a content control. An XML mapping is a link between the text in a content control and an XML element in the custom XML data store for this document.