Skip to content
本页内容

Comments (属性)

返回一个 Comments 集合,该集合表示指定工作表的所有注释。只读。

示例

python
#本示例删除活动工作表中由 Jean Selva 添加的所有批注
def test():
    for i in range(1, Application.Comments.Count):
        c = ActiveSheet.Comments.Item(i)
        if c.Author == "Jean Selva":
            c.Delete()
python
#本示例在第一张工作表A1单元格添加一条批注,并将所有批注设置为隐藏,并通知用户批注数量
def test():
    Worksheets.Item(1).Range("A1").AddComment("This is a tips")
    Worksheets.Item(1).Comments.Visible = False
    print(Worksheets.Item(1).Comments.Count)