Word.ContentControlType enum
Specifies supported content control types and subtypes.
Remarks
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/insert-and-change-checkbox-content-control.yaml
// Traverses each paragraph of the document and places a checkbox content control at the beginning of each.
await Word.run(async (context) => {
let paragraphs = context.document.body.paragraphs;
paragraphs.load("$none"); // Don't need any properties; just start each paragraph with a content control.
await context.sync();
for (let i = 0; i < paragraphs.items.length; i++) {
let contentControl = paragraphs.items[i]
.getRange(Word.RangeLocation.start)
.insertContentControl(Word.ContentControlType.checkBox);
}
console.log("Checkbox content controls inserted: " + paragraphs.items.length);
await context.sync();
});
Fields
| buildingBlockGallery = "BuildingBlockGallery" | Building block gallery content control (type and subtype). |
| checkBox = "CheckBox" | Check box content control (type and subtype). |
| comboBox = "ComboBox" | Combo box content control (type and subtype). |
| datePicker = "DatePicker" | Date picker content control (type and subtype). |
| dropDownList = "DropDownList" | Dropdown list content control (type and subtype). |
| group = "Group" | Group content control type. |
| picture = "Picture" | Picture content control (type and subtype). |
| plainText = "PlainText" | Plain text content control type. |
| plainTextInline = "PlainTextInline" | Plain text content control subtype containing inline elements. |
| plainTextParagraph = "PlainTextParagraph" | Plain text content control subtype containing paragraphs. |
| repeatingSection = "RepeatingSection" | Repeating section content control (type and subtype). |
| richText = "RichText" | Rich text content control type. |
| richTextInline = "RichTextInline" | Rich text content control subtype containing inline elements. |
| richTextParagraphs = "RichTextParagraphs" | Rich text content control subtype containing paragraphs. |
| richTextTable = "RichTextTable" | Rich text content control subtype containing a whole table. |
| richTextTableCell = "RichTextTableCell" | Rich text content control subtype containing a whole cell. |
| richTextTableRow = "RichTextTableRow" | Rich text content control subtype containing a whole row. |
| unknown = "Unknown" | Unknown content control type. |