Word.Interfaces.ContentControlData interface
一个接口,用于描述通过调用 contentControl.toJSON()返回的数据。
属性
| appearance | 指定内容控件的外观。 该值可以是 |
| cannot |
指定一个值,该值指示用户是否可以删除内容控件。 与 |
| cannot |
指定一个值,该值指示用户是否可以编辑内容控件的内容。 |
| color | 指定内容控件的颜色。 颜色以“#RRGGBB”格式或使用颜色名称指定。 |
| content |
获取内容控件中对象的集合 |
| font | 获取内容控件的文本格式。 使用此对象获取和设置字体名称、大小、颜色和其他属性。 |
| id | 获取表示内容控件标识符的整数。 |
| inline |
获取内容控件中对象的集合 |
| paragraphs | 获取内容控件中对象的集合 |
| placeholder |
指定内容控件的占位符文本。 内容控件为空时,将显示灰色的文本。 |
| remove |
指定一个值,该值指示内容控件在编辑后是否将其删除。 与 |
| style | 指定内容控件的样式名称。 请对自定义样式和本地化样式名称使用此属性。 若要使用在区域设置之间可移植的内置样式,请参阅 |
| tag | 指定用于标识内容控件的标记。 |
| text | 获取内容控件的文本。 |
| title | 指定内容控件的标题。 |
| type | 获取内容控件的类型。 目前仅支持格式文本、纯文本、检查框、下拉列表、组合框、构建基块库、日期选取器、重复部分、图片和组内容控件。 |
属性详细信息
appearance
指定内容控件的外观。 该值可以是 boundingBox、 tags或 hidden。
appearance?: Word.ContentControlAppearance | "BoundingBox" | "Tags" | "Hidden";
属性值
Word.ContentControlAppearance | "BoundingBox" | "Tags" | "Hidden"
注解
cannotDelete
指定一个值,该值指示用户是否可以删除内容控件。 与 removeWhenEdited互斥。
cannotDelete?: boolean;
属性值
boolean
注解
cannotEdit
color
contentControls
获取内容控件中对象的集合 ContentControl 。
contentControls?: Word.Interfaces.ContentControlData[];
属性值
注解
font
获取内容控件的文本格式。 使用此对象获取和设置字体名称、大小、颜色和其他属性。
font?: Word.Interfaces.FontData;
属性值
注解
id
inlinePictures
获取内容控件中对象的集合 InlinePicture 。 集合不包括浮动图像。
inlinePictures?: Word.Interfaces.InlinePictureData[];
属性值
注解
paragraphs
获取内容控件中对象的集合 Paragraph 。
paragraphs?: Word.Interfaces.ParagraphData[];
属性值
注解
重要提示:对于要求集 1.1 和 1.2,不会返回完全包含在此内容控件中的表中的段落。 从要求集 1.3 中,还会返回此类表中的段落。
placeholderText
removeWhenEdited
指定一个值,该值指示内容控件在编辑后是否将其删除。 与 cannotDelete互斥。
removeWhenEdited?: boolean;
属性值
boolean
注解
style
指定内容控件的样式名称。 请对自定义样式和本地化样式名称使用此属性。 若要使用在区域设置之间可移植的内置样式,请参阅 styleBuiltIn 属性。
style?: string;
属性值
string
注解
tag
text
title
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"