Word.Interfaces.ContentControlData interface

一个描述通过调用 contentControl.toJSON()返回的数据的接口。

注解

使用方

属性

appearance

指定内容控件的外观。 值可以是 boundingBoxtagshidden

buildingBlockGalleryContentControl

如果内容控件为 Word,则获取与构建基块库相关的数据。ContentControlType is buildingBlockGallery. 情况并非 null 如此。

cannotDelete

指定用户是否可以删除内容控件。 与 removeWhenEdited互斥。

cannotEdit

指定用户是否可以编辑内容控件的内容。

checkboxContentControl

获取内容控件的数据(当其类型为 checkBox时)。 情况并非 null 如此。

color

指定内容控件的颜色。 颜色以“#RRGGBB”格式或使用颜色名称指定。

comboBoxContentControl

获取内容控件的数据(当其类型为 comboBox时)。 情况并非 null 如此。

contentControls

获取内容控件中的对象集合 ContentControl

datePickerContentControl

如果内容控件为 Word,则获取日期选取器相关数据。ContentControlType is datePicker. 情况并非 null 如此。

dropDownListContentControl

获取内容控件的数据(当其类型为 dropDownList时)。 情况并非 null 如此。

fields

获取内容控件中的对象集合 Field

font

获取内容控件的文本格式。 使用此对象获取和设置字体名称、大小、颜色和其他属性。

groupContentControl

如果内容控件为 Word,则获取与组相关的数据。ContentControlType is group. 情况并非 null 如此。

id

获取表示内容控件标识符的整数。

inlinePictures

获取内容控件中的对象集合 InlinePicture 。 该集合不包括浮动图像。

lists

获取内容控件中的对象集合 List

paragraphs

获取内容控件中的对象集合 Paragraph

pictureContentControl

如果是内容控件的 Word,则获取与图片相关的数据。ContentControlType is picture. 情况并非 null 如此。

placeholderText

指定内容控件的占位符文本。 内容控件为空时,将显示灰色的文本。

removeWhenEdited

指定是否在编辑内容控件后将其删除。 与 cannotDelete互斥。

repeatingSectionContentControl

如果是内容控件的 Word,则获取与重复节相关的数据。ContentControlType is repeatingSection. 情况并非 null 如此。

style

指定内容控件的样式名称。 请对自定义样式和本地化样式名称使用此属性。 若要使用可在区域设置之间移植的内置样式,请参阅 styleBuiltIn 属性。

styleBuiltIn

指定内容控件的内置样式名称。 请对可以在区域设置之间移植的嵌入样式使用此属性。 要使用自定义样式或本地化样式名称,请参阅 style 属性。

subtype

获取 contentControl 的子类型。 子类型可以是 richTextInlinerichTextParagraphsrichTextTableCellrichTextTableRowrichTextTable以及格式文本内容控件,plainTextParagraphplainTextInline对于纯文本内容控件,checkBox对于复选框内容控件,dropDownList对于下拉列表内容控件,comboBox对于组合框内容控件,对于构建基块库内容控件datePickerbuildingBlockGallery对于日期选取器内容控件,repeatingSection对于重复节内容控件,picture对于图片内容控件group,对于组内容控件。

tables

获取内容控件中的对象集合 Table

tag

指定用于标识内容控件的标记。

text

获取内容控件的文本。

title

指定内容控件的标题。

type

获取内容控件的类型。 目前仅支持富文本、纯文本、检查框、下拉列表、组合框、构建基块库、日期选取器、重复节、图片和组内容控件。

xmlMapping

返回一个 XmlMapping 对象,该对象表示内容控件到文档数据存储中 XML 数据的映射。

属性详细信息

appearance

指定内容控件的外观。 值可以是 boundingBoxtagshidden

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

属性值

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

注解

API 集:WordApi 1.1

buildingBlockGalleryContentControl

如果内容控件为 Word,则获取与构建基块库相关的数据。ContentControlType is buildingBlockGallery. 情况并非 null 如此。

buildingBlockGalleryContentControl?: Word.Interfaces.BuildingBlockGalleryContentControlData;

属性值

注解

API 集:WordApiDesktop 1.3

cannotDelete

指定用户是否可以删除内容控件。 与 removeWhenEdited互斥。

cannotDelete?: boolean;

属性值

boolean

注解

API 集:WordApi 1.1

cannotEdit

指定用户是否可以编辑内容控件的内容。

cannotEdit?: boolean;

属性值

boolean

注解

API 集:WordApi 1.1

checkboxContentControl

获取内容控件的数据(当其类型为 checkBox时)。 情况并非 null 如此。

checkboxContentControl?: Word.Interfaces.CheckboxContentControlData;

属性值

注解

API 集:WordApi 1.7

color

指定内容控件的颜色。 颜色以“#RRGGBB”格式或使用颜色名称指定。

color?: string;

属性值

string

注解

API 集:WordApi 1.1

comboBoxContentControl

获取内容控件的数据(当其类型为 comboBox时)。 情况并非 null 如此。

comboBoxContentControl?: Word.Interfaces.ComboBoxContentControlData;

属性值

注解

API 集:WordApi 1.9

contentControls

获取内容控件中的对象集合 ContentControl

contentControls?: Word.Interfaces.ContentControlData[];

属性值

注解

API 集:WordApi 1.1

datePickerContentControl

如果内容控件为 Word,则获取日期选取器相关数据。ContentControlType is datePicker. 情况并非 null 如此。

datePickerContentControl?: Word.Interfaces.DatePickerContentControlData;

属性值

注解

API 集:WordApiDesktop 1.3

dropDownListContentControl

获取内容控件的数据(当其类型为 dropDownList时)。 情况并非 null 如此。

dropDownListContentControl?: Word.Interfaces.DropDownListContentControlData;

属性值

注解

API 集:WordApi 1.9

fields

获取内容控件中的对象集合 Field

fields?: Word.Interfaces.FieldData[];

属性值

注解

API 集:WordApi 1.4

font

获取内容控件的文本格式。 使用此对象获取和设置字体名称、大小、颜色和其他属性。

font?: Word.Interfaces.FontData;

属性值

注解

API 集:WordApi 1.1

groupContentControl

如果内容控件为 Word,则获取与组相关的数据。ContentControlType is group. 情况并非 null 如此。

groupContentControl?: Word.Interfaces.GroupContentControlData;

属性值

注解

API 集:WordApiDesktop 1.3

id

获取表示内容控件标识符的整数。

id?: number;

属性值

number

注解

API 集:WordApi 1.1

inlinePictures

获取内容控件中的对象集合 InlinePicture 。 该集合不包括浮动图像。

inlinePictures?: Word.Interfaces.InlinePictureData[];

属性值

注解

API 集:WordApi 1.1

lists

获取内容控件中的对象集合 List

lists?: Word.Interfaces.ListData[];

属性值

注解

API 集:WordApi 1.3

paragraphs

获取内容控件中的对象集合 Paragraph

paragraphs?: Word.Interfaces.ParagraphData[];

属性值

注解

API 集:WordApi 1.1

重要提示: 对于要求集 1.1 和 1.2,不会返回完全包含在此内容控件中的表中的段落。 从要求集1.3中,还返回此类表中的段落。

pictureContentControl

如果是内容控件的 Word,则获取与图片相关的数据。ContentControlType is picture. 情况并非 null 如此。

pictureContentControl?: Word.Interfaces.PictureContentControlData;

属性值

注解

API 集:WordApiDesktop 1.3

placeholderText

指定内容控件的占位符文本。 内容控件为空时,将显示灰色的文本。

placeholderText?: string;

属性值

string

注解

API 集:WordApi 1.1

removeWhenEdited

指定是否在编辑内容控件后将其删除。 与 cannotDelete互斥。

removeWhenEdited?: boolean;

属性值

boolean

注解

API 集:WordApi 1.1

repeatingSectionContentControl

如果是内容控件的 Word,则获取与重复节相关的数据。ContentControlType is repeatingSection. 情况并非 null 如此。

repeatingSectionContentControl?: Word.Interfaces.RepeatingSectionContentControlData;

属性值

注解

API 集:WordApiDesktop 1.3

style

指定内容控件的样式名称。 请对自定义样式和本地化样式名称使用此属性。 若要使用可在区域设置之间移植的内置样式,请参阅 styleBuiltIn 属性。

style?: string;

属性值

string

注解

API 集:WordApi 1.1

styleBuiltIn

指定内容控件的内置样式名称。 请对可以在区域设置之间移植的嵌入样式使用此属性。 要使用自定义样式或本地化样式名称,请参阅 style 属性。

styleBuiltIn?: Word.BuiltInStyleName | "Other" | "Normal" | "Heading1" | "Heading2" | "Heading3" | "Heading4" | "Heading5" | "Heading6" | "Heading7" | "Heading8" | "Heading9" | "Toc1" | "Toc2" | "Toc3" | "Toc4" | "Toc5" | "Toc6" | "Toc7" | "Toc8" | "Toc9" | "FootnoteText" | "Header" | "Footer" | "Caption" | "FootnoteReference" | "EndnoteReference" | "EndnoteText" | "Title" | "Subtitle" | "Hyperlink" | "Strong" | "Emphasis" | "NoSpacing" | "ListParagraph" | "Quote" | "IntenseQuote" | "SubtleEmphasis" | "IntenseEmphasis" | "SubtleReference" | "IntenseReference" | "BookTitle" | "Bibliography" | "TocHeading" | "TableGrid" | "PlainTable1" | "PlainTable2" | "PlainTable3" | "PlainTable4" | "PlainTable5" | "TableGridLight" | "GridTable1Light" | "GridTable1Light_Accent1" | "GridTable1Light_Accent2" | "GridTable1Light_Accent3" | "GridTable1Light_Accent4" | "GridTable1Light_Accent5" | "GridTable1Light_Accent6" | "GridTable2" | "GridTable2_Accent1" | "GridTable2_Accent2" | "GridTable2_Accent3" | "GridTable2_Accent4" | "GridTable2_Accent5" | "GridTable2_Accent6" | "GridTable3" | "GridTable3_Accent1" | "GridTable3_Accent2" | "GridTable3_Accent3" | "GridTable3_Accent4" | "GridTable3_Accent5" | "GridTable3_Accent6" | "GridTable4" | "GridTable4_Accent1" | "GridTable4_Accent2" | "GridTable4_Accent3" | "GridTable4_Accent4" | "GridTable4_Accent5" | "GridTable4_Accent6" | "GridTable5Dark" | "GridTable5Dark_Accent1" | "GridTable5Dark_Accent2" | "GridTable5Dark_Accent3" | "GridTable5Dark_Accent4" | "GridTable5Dark_Accent5" | "GridTable5Dark_Accent6" | "GridTable6Colorful" | "GridTable6Colorful_Accent1" | "GridTable6Colorful_Accent2" | "GridTable6Colorful_Accent3" | "GridTable6Colorful_Accent4" | "GridTable6Colorful_Accent5" | "GridTable6Colorful_Accent6" | "GridTable7Colorful" | "GridTable7Colorful_Accent1" | "GridTable7Colorful_Accent2" | "GridTable7Colorful_Accent3" | "GridTable7Colorful_Accent4" | "GridTable7Colorful_Accent5" | "GridTable7Colorful_Accent6" | "ListTable1Light" | "ListTable1Light_Accent1" | "ListTable1Light_Accent2" | "ListTable1Light_Accent3" | "ListTable1Light_Accent4" | "ListTable1Light_Accent5" | "ListTable1Light_Accent6" | "ListTable2" | "ListTable2_Accent1" | "ListTable2_Accent2" | "ListTable2_Accent3" | "ListTable2_Accent4" | "ListTable2_Accent5" | "ListTable2_Accent6" | "ListTable3" | "ListTable3_Accent1" | "ListTable3_Accent2" | "ListTable3_Accent3" | "ListTable3_Accent4" | "ListTable3_Accent5" | "ListTable3_Accent6" | "ListTable4" | "ListTable4_Accent1" | "ListTable4_Accent2" | "ListTable4_Accent3" | "ListTable4_Accent4" | "ListTable4_Accent5" | "ListTable4_Accent6" | "ListTable5Dark" | "ListTable5Dark_Accent1" | "ListTable5Dark_Accent2" | "ListTable5Dark_Accent3" | "ListTable5Dark_Accent4" | "ListTable5Dark_Accent5" | "ListTable5Dark_Accent6" | "ListTable6Colorful" | "ListTable6Colorful_Accent1" | "ListTable6Colorful_Accent2" | "ListTable6Colorful_Accent3" | "ListTable6Colorful_Accent4" | "ListTable6Colorful_Accent5" | "ListTable6Colorful_Accent6" | "ListTable7Colorful" | "ListTable7Colorful_Accent1" | "ListTable7Colorful_Accent2" | "ListTable7Colorful_Accent3" | "ListTable7Colorful_Accent4" | "ListTable7Colorful_Accent5" | "ListTable7Colorful_Accent6";

属性值

Word.BuiltInStyleName | "Other" | "Normal" | "Heading1" | "Heading2" | "Heading3" | "Heading4" | "Heading5" | "Heading6" | "Heading7" | "Heading8" | "Heading9" | "Toc1" | "Toc2" | "Toc3" | "Toc4" | "Toc5" | "Toc6" | "Toc7" | "Toc8" | "Toc9" | "FootnoteText" | "Header" | "Footer" | "Caption" | "FootnoteReference" | "EndnoteReference" | "EndnoteText" | "Title" | "Subtitle" | "Hyperlink" | "Strong" | "Emphasis" | "NoSpacing" | "ListParagraph" | "Quote" | "IntenseQuote" | "SubtleEmphasis" | "IntenseEmphasis" | "SubtleReference" | "IntenseReference" | "BookTitle" | "Bibliography" | "TocHeading" | "TableGrid" | "PlainTable1" | "PlainTable2" | "PlainTable3" | "PlainTable4" | "PlainTable5" | "TableGridLight" | "GridTable1Light" | "GridTable1Light_Accent1" | "GridTable1Light_Accent2" | "GridTable1Light_Accent3" | "GridTable1Light_Accent4" | "GridTable1Light_Accent5" | "GridTable1Light_Accent6" | "GridTable2" | "GridTable2_Accent1" | "GridTable2_Accent2" | "GridTable2_Accent3" | "GridTable2_Accent4" | "GridTable2_Accent5" | "GridTable2_Accent6" | "GridTable3" | "GridTable3_Accent1" | "GridTable3_Accent2" | "GridTable3_Accent3" | "GridTable3_Accent4" | "GridTable3_Accent5" | "GridTable3_Accent6" | "GridTable4" | "GridTable4_Accent1" | "GridTable4_Accent2" | "GridTable4_Accent3" | "GridTable4_Accent4" | "GridTable4_Accent5" | "GridTable4_Accent6" | "GridTable5Dark" | "GridTable5Dark_Accent1" | "GridTable5Dark_Accent2" | "GridTable5Dark_Accent3" | "GridTable5Dark_Accent4" | "GridTable5Dark_Accent5" | "GridTable5Dark_Accent6" | "GridTable6Colorful" | "GridTable6Colorful_Accent1" | "GridTable6Colorful_Accent2" | "GridTable6Colorful_Accent3" | "GridTable6Colorful_Accent4" | "GridTable6Colorful_Accent5" | "GridTable6Colorful_Accent6" | "GridTable7Colorful" | "GridTable7Colorful_Accent1" | "GridTable7Colorful_Accent2" | "GridTable7Colorful_Accent3" | "GridTable7Colorful_Accent4" | "GridTable7Colorful_Accent5" | "GridTable7Colorful_Accent6" | "ListTable1Light" | "ListTable1Light_Accent1" | "ListTable1Light_Accent2" | "ListTable1Light_Accent3" | "ListTable1Light_Accent4" | "ListTable1Light_Accent5" | "ListTable1Light_Accent6" | "ListTable2" | "ListTable2_Accent1" | "ListTable2_Accent2" | "ListTable2_Accent3" | "ListTable2_Accent4" | "ListTable2_Accent5" | "ListTable2_Accent6" | "ListTable3" | "ListTable3_Accent1" | "ListTable3_Accent2" | "ListTable3_Accent3" | "ListTable3_Accent4" | "ListTable3_Accent5" | "ListTable3_Accent6" | "ListTable4" | "ListTable4_Accent1" | "ListTable4_Accent2" | "ListTable4_Accent3" | "ListTable4_Accent4" | "ListTable4_Accent5" | "ListTable4_Accent6" | "ListTable5Dark" | "ListTable5Dark_Accent1" | "ListTable5Dark_Accent2" | "ListTable5Dark_Accent3" | "ListTable5Dark_Accent4" | "ListTable5Dark_Accent5" | "ListTable5Dark_Accent6" | "ListTable6Colorful" | "ListTable6Colorful_Accent1" | "ListTable6Colorful_Accent2" | "ListTable6Colorful_Accent3" | "ListTable6Colorful_Accent4" | "ListTable6Colorful_Accent5" | "ListTable6Colorful_Accent6" | "ListTable7Colorful" | "ListTable7Colorful_Accent1" | "ListTable7Colorful_Accent2" | "ListTable7Colorful_Accent3" | "ListTable7Colorful_Accent4" | "ListTable7Colorful_Accent5" | "ListTable7Colorful_Accent6"

注解

API 集:WordApi 1.3

subtype

获取 contentControl 的子类型。 子类型可以是 richTextInlinerichTextParagraphsrichTextTableCellrichTextTableRowrichTextTable以及格式文本内容控件,plainTextParagraphplainTextInline对于纯文本内容控件,checkBox对于复选框内容控件,dropDownList对于下拉列表内容控件,comboBox对于组合框内容控件,对于构建基块库内容控件datePickerbuildingBlockGallery对于日期选取器内容控件,repeatingSection对于重复节内容控件,picture对于图片内容控件group,对于组内容控件。

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

属性值

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

注解

API 集:WordApi 1.3

tables

获取内容控件中的对象集合 Table

tables?: Word.Interfaces.TableData[];

属性值

注解

API 集:WordApi 1.3

tag

指定用于标识内容控件的标记。

tag?: string;

属性值

string

注解

API 集:WordApi 1.1

text

获取内容控件的文本。

text?: string;

属性值

string

注解

API 集:WordApi 1.1

title

指定内容控件的标题。

title?: string;

属性值

string

注解

API 集:WordApi 1.1

type

获取内容控件的类型。 目前仅支持富文本、纯文本、检查框、下拉列表、组合框、构建基块库、日期选取器、重复节、图片和组内容控件。

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

属性值

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

注解

API 集:WordApi 1.1

xmlMapping

返回一个 XmlMapping 对象,该对象表示内容控件到文档数据存储中 XML 数据的映射。

xmlMapping?: Word.Interfaces.XmlMappingData;

属性值

注解

API 集:WordApiDesktop 1.3