Word.Interfaces.ContentControlData interface

An interface describing the data returned by calling contentControl.toJSON().

Properties

appearance

Specifies the appearance of the content control. The value can be 'BoundingBox', 'Tags', or 'Hidden'.

cannotDelete

Specifies a value that indicates whether the user can delete the content control. Mutually exclusive with removeWhenEdited.

cannotEdit

Specifies a value that indicates whether the user can edit the contents of the content control.

color

Specifies the color of the content control. Color is specified in '#RRGGBB' format or by using the color name.

contentControls

Gets the collection of content control objects in the content control.

font

Gets the text format of the content control. Use this to get and set font name, size, color, and other properties.

id

Gets an integer that represents the content control identifier.

inlinePictures

Gets the collection of InlinePicture objects in the content control. The collection doesn't include floating images.

paragraphs

Gets the collection of paragraph objects in the content control.

placeholderText

Specifies the placeholder text of the content control. Dimmed text will be displayed when the content control is empty.

Note: The set operation for this property isn't supported in Word on the web.

removeWhenEdited

Specifies a value that indicates whether the content control is removed after it is edited. Mutually exclusive with cannotDelete.

style

Specifies the style name for the content control. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property.

tag

Specifies a tag to identify a content control.

text

Gets the text of the content control.

title

Specifies the title for a content control.

type

Gets the content control type. Only rich text, plain text, and checkbox content controls are supported currently.

Property Details

appearance

Specifies the appearance of the content control. The value can be 'BoundingBox', 'Tags', or 'Hidden'.

appearance?: Word.ContentControlAppearance | "BoundingBox" | "Tags" | "Hidden";

Property Value

Word.ContentControlAppearance | "BoundingBox" | "Tags" | "Hidden"

Remarks

[ API set: WordApi 1.1 ]

cannotDelete

Specifies a value that indicates whether the user can delete the content control. Mutually exclusive with removeWhenEdited.

cannotDelete?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.1 ]

cannotEdit

Specifies a value that indicates whether the user can edit the contents of the content control.

cannotEdit?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.1 ]

color

Specifies the color of the content control. Color is specified in '#RRGGBB' format or by using the color name.

color?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

contentControls

Gets the collection of content control objects in the content control.

contentControls?: Word.Interfaces.ContentControlData[];

Property Value

Remarks

[ API set: WordApi 1.1 ]

font

Gets the text format of the content control. Use this to get and set font name, size, color, and other properties.

font?: Word.Interfaces.FontData;

Property Value

Remarks

[ API set: WordApi 1.1 ]

id

Gets an integer that represents the content control identifier.

id?: number;

Property Value

number

Remarks

[ API set: WordApi 1.1 ]

inlinePictures

Gets the collection of InlinePicture objects in the content control. The collection doesn't include floating images.

inlinePictures?: Word.Interfaces.InlinePictureData[];

Property Value

Remarks

[ API set: WordApi 1.1 ]

paragraphs

Gets the collection of paragraph objects in the content control.

paragraphs?: Word.Interfaces.ParagraphData[];

Property Value

Remarks

[ API set: WordApi 1.1 ]

Important: For requirement sets 1.1 and 1.2, paragraphs in tables wholly contained within this content control aren't returned. From requirement set 1.3, paragraphs in such tables are also returned.

placeholderText

Specifies the placeholder text of the content control. Dimmed text will be displayed when the content control is empty.

Note: The set operation for this property isn't supported in Word on the web.

placeholderText?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

removeWhenEdited

Specifies a value that indicates whether the content control is removed after it is edited. Mutually exclusive with cannotDelete.

removeWhenEdited?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.1 ]

style

Specifies the style name for the content control. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property.

style?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

tag

Specifies a tag to identify a content control.

tag?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

text

Gets the text of the content control.

text?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

title

Specifies the title for a content control.

title?: string;

Property Value

string

Remarks

[ API set: WordApi 1.1 ]

type

Gets the content control type. Only rich text, plain text, and checkbox content controls are supported currently.

type?: Word.ContentControlType | "Unknown" | "RichTextInline" | "RichTextParagraphs" | "RichTextTableCell" | "RichTextTableRow" | "RichTextTable" | "PlainTextInline" | "PlainTextParagraph" | "Picture" | "BuildingBlockGallery" | "CheckBox" | "ComboBox" | "DropDownList" | "DatePicker" | "RepeatingSection" | "RichText" | "PlainText";

Property Value

Word.ContentControlType | "Unknown" | "RichTextInline" | "RichTextParagraphs" | "RichTextTableCell" | "RichTextTableRow" | "RichTextTable" | "PlainTextInline" | "PlainTextParagraph" | "Picture" | "BuildingBlockGallery" | "CheckBox" | "ComboBox" | "DropDownList" | "DatePicker" | "RepeatingSection" | "RichText" | "PlainText"

Remarks

[ API set: WordApi 1.1 ]