Word.ContentControlType enum
サポートされているコンテンツ コントロールの種類とサブタイプを指定します。
注釈
例
// 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();
});
フィールド
| buildingBlockGallery = "BuildingBlockGallery" | 文書パーツ ギャラリー コンテンツ コントロール (型とサブタイプ)。 |
| checkBox = "CheckBox" | チェック ボックス コンテンツ コントロール (種類とサブタイプ)。 |
| comboBox = "ComboBox" | コンボ ボックス コンテンツ コントロール (型とサブタイプ)。 |
| datePicker = "DatePicker" | 日付ピッカー コンテンツ コントロール (型とサブタイプ)。 |
| dropDownList = "DropDownList" | ドロップダウン リスト コンテンツ コントロール (種類とサブタイプ)。 |
| group = "Group" | グループ コンテンツ コントロールの種類。 |
| picture = "Picture" | 画像コンテンツ コントロール (型とサブタイプ)。 |
| plainText = "PlainText" | プレーン テキスト コンテンツ コントロールの種類。 |
| plainTextInline = "PlainTextInline" | インライン要素を含むプレーン テキスト コンテンツ コントロール サブタイプ。 |
| plainTextParagraph = "PlainTextParagraph" | 段落を含むプレーン テキスト コンテンツ コントロール サブタイプ。 |
| repeatingSection = "RepeatingSection" | 繰り返しセクション コンテンツ コントロール (型とサブタイプ)。 |
| richText = "RichText" | リッチ テキスト コンテンツ コントロールの種類。 |
| richTextInline = "RichTextInline" | インライン要素を含むリッチ テキスト コンテンツ コントロール サブタイプ。 |
| richTextParagraphs = "RichTextParagraphs" | 段落を含むリッチ テキスト コンテンツ コントロール サブタイプ。 |
| richTextTable = "RichTextTable" | テーブル全体を含むリッチ テキスト コンテンツ コントロール サブタイプ。 |
| richTextTableCell = "RichTextTableCell" | セル全体を含むリッチ テキスト コンテンツ コントロール サブタイプ。 |
| richTextTableRow = "RichTextTableRow" | 行全体を含むリッチ テキスト コンテンツ コントロール サブタイプ。 |
| unknown = "Unknown" | 不明なコンテンツ コントロールの種類。 |