Word.Interfaces.ContentControlData interface

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

属性

appearance

指定内容控件的外观。 该值可以是“BoundingBox”、“Tags”或“Hidden”。

cannotDelete

指定一个值,该值指示用户是否可以删除内容控件。 与 removeWhenEdited 互相排斥。

cannotEdit

指定一个值,该值指示用户是否可以编辑内容控件的内容。

color

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

contentControls

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

fields

获取内容控件中字段对象的集合。

font

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

id

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

inlinePictures

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

lists

获取 contentControl 中的一组 list 对象。

paragraphs

获取内容控件中段落对象的集合。

placeholderText

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

注意:web 上的Word不支持此属性的设置操作。

removeWhenEdited

指定一个值,该值指示内容控件在编辑后是否将其删除。 与 cannotDelete 互相排斥。

style

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

styleBuiltIn

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

subtype

获取 contentControl 的子类型。 对于富文本内容控件,子类型可以是“RichTextInline”、“RichTextParagraphs”、“RichTextTableCell”、“RichTextTableRow”和“RichTextTable”,或者对于纯文本内容控件,可以是“PlainTextInline”和“PlainTextParagraph”,也可以是复选框内容控件的“CheckBox”。

tables

获取 contentControl 中的一组 table 对象。

tag

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

text

获取内容控件的文本。

title

指定内容控件的标题。

type

获取内容控件的类型。 目前仅支持格式文本、纯文本和复选框内容控件。

属性详细信息

appearance

指定内容控件的外观。 该值可以是“BoundingBox”、“Tags”或“Hidden”。

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

属性值

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

注解

[ API 集:WordApi 1.1 ]

cannotDelete

指定一个值,该值指示用户是否可以删除内容控件。 与 removeWhenEdited 互相排斥。

cannotDelete?: boolean;

属性值

boolean

注解

[ API 集:WordApi 1.1 ]

cannotEdit

指定一个值,该值指示用户是否可以编辑内容控件的内容。

cannotEdit?: boolean;

属性值

boolean

注解

[ API 集:WordApi 1.1 ]

color

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

color?: string;

属性值

string

注解

[ API 集:WordApi 1.1 ]

contentControls

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

contentControls?: Word.Interfaces.ContentControlData[];

属性值

注解

[ API 集:WordApi 1.1 ]

fields

获取内容控件中字段对象的集合。

fields?: Word.Interfaces.FieldData[];

属性值

注解

[ API 集:WordApi 1.4 ]

font

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

font?: Word.Interfaces.FontData;

属性值

注解

[ API 集:WordApi 1.1 ]

id

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

id?: number;

属性值

number

注解

[ API 集:WordApi 1.1 ]

inlinePictures

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

inlinePictures?: Word.Interfaces.InlinePictureData[];

属性值

注解

[ API 集:WordApi 1.1 ]

lists

获取 contentControl 中的一组 list 对象。

lists?: Word.Interfaces.ListData[];

属性值

注解

[ API 集:WordApi 1.3 ]

paragraphs

获取内容控件中段落对象的集合。

paragraphs?: Word.Interfaces.ParagraphData[];

属性值

注解

[ API 集:WordApi 1.1 ]

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

placeholderText

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

注意:web 上的Word不支持此属性的设置操作。

placeholderText?: string;

属性值

string

注解

[ API 集:WordApi 1.1 ]

removeWhenEdited

指定一个值,该值指示内容控件在编辑后是否将其删除。 与 cannotDelete 互相排斥。

removeWhenEdited?: boolean;

属性值

boolean

注解

[ API 集:WordApi 1.1 ]

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 的子类型。 对于富文本内容控件,子类型可以是“RichTextInline”、“RichTextParagraphs”、“RichTextTableCell”、“RichTextTableRow”和“RichTextTable”,或者对于纯文本内容控件,可以是“PlainTextInline”和“PlainTextParagraph”,也可以是复选框内容控件的“CheckBox”。

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

属性值

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

注解

[ API 集:WordApi 1.3 ]

tables

获取 contentControl 中的一组 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";

属性值

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

注解

[ API 集:WordApi 1.1 ]