ExcelScript.Comment interface

表示工作簿中的注释。

方法

addCommentReply(content, contentType)

为批注创建批注回复。

delete()

删除批注和所有已连接的回复。

getAuthorEmail()

获取批注作者的电子邮件。

getAuthorName()

获取批注作者的姓名。

getCommentReply(commentReplyId)

返回由其 ID 标识的批注回复。 如果注释回复对象不存在,则此方法返回 undefined

getContent()

批注的内容。 字符串为纯文本。

getContentType()

获取批注的内容类型。

getCreationDate()

获取批注的创建时间。 null如果注释是从笔记转换的,则返回 ,因为注释没有创建日期。

getId()

指定注释标识符。

getLocation()

获取此注释所在的单元格。

getMentions()

获取 (实体,例如注释中提到的人员) 。

getReplies()

表示与批注关联的回复对象的集合。

getResolved()

注释线程状态。 值 true 表示已解析注释线程。

getRichContent()

获取丰富的批注内容 (例如注释) 中的提及。 此字符串不应显示给最终用户。 您的外接程序应仅使用它来分析丰富的注释内容。

setContent(content)

批注的内容。 字符串为纯文本。

setResolved(resolved)

注释线程状态。 值 true 表示已解析注释线程。

updateMentions(contentWithMentions)

使用特殊格式的字符串和提及列表汇报注释内容。

方法详细信息

addCommentReply(content, contentType)

为批注创建批注回复。

addCommentReply(
            content: CommentRichContent | string,
            contentType?: ContentType
        ): CommentReply;

参数

content

ExcelScript.CommentRichContent | string

批注的内容。 这可以是字符串或 CommentRichContent 对象 (例如,对于带有提及) 的注释。

contentType
ExcelScript.ContentType

可选。 批注中包含的内容类型。 默认值为 enum ContentType.Plain

返回

delete()

删除批注和所有已连接的回复。

delete(): void;

返回

void

getAuthorEmail()

获取批注作者的电子邮件。

getAuthorEmail(): string;

返回

string

getAuthorName()

获取批注作者的姓名。

getAuthorName(): string;

返回

string

getCommentReply(commentReplyId)

返回由其 ID 标识的批注回复。 如果注释回复对象不存在,则此方法返回 undefined

getCommentReply(commentReplyId: string): CommentReply | undefined;

参数

commentReplyId

string

批注答复的标识符。

返回

getContent()

批注的内容。 字符串为纯文本。

getContent(): string;

返回

string

getContentType()

获取批注的内容类型。

getContentType(): ContentType;

返回

getCreationDate()

获取批注的创建时间。 null如果注释是从笔记转换的,则返回 ,因为注释没有创建日期。

getCreationDate(): Date;

返回

Date

getId()

指定注释标识符。

getId(): string;

返回

string

getLocation()

获取此注释所在的单元格。

getLocation(): Range;

返回

getMentions()

获取 (实体,例如注释中提到的人员) 。

getMentions(): CommentMention[];

返回

getReplies()

表示与批注关联的回复对象的集合。

getReplies(): CommentReply[];

返回

getResolved()

注释线程状态。 值 true 表示已解析注释线程。

getResolved(): boolean;

返回

boolean

getRichContent()

获取丰富的批注内容 (例如注释) 中的提及。 此字符串不应显示给最终用户。 您的外接程序应仅使用它来分析丰富的注释内容。

getRichContent(): string;

返回

string

setContent(content)

批注的内容。 字符串为纯文本。

setContent(content: string): void;

参数

content

string

返回

void

setResolved(resolved)

注释线程状态。 值 true 表示已解析注释线程。

setResolved(resolved: boolean): void;

参数

resolved

boolean

返回

void

updateMentions(contentWithMentions)

使用特殊格式的字符串和提及列表汇报注释内容。

updateMentions(contentWithMentions: CommentRichContent): void;

参数

contentWithMentions
ExcelScript.CommentRichContent

批注的内容。 它包含一个特殊格式的字符串和一个提及列表,这些提及将在 Excel 显示时解析为字符串。

返回

void