CopyCommentsInRange

ShapeCollection.CopyCommentsInRange method

复制范围内的所有评论。

public void CopyCommentsInRange(ShapeCollection shapes, CellArea ca, int destRow, int destColumn)
范围类型描述
shapesShapeCollection源形状。
caCellArea源范围。
destRowInt32dest 范围开始行。
destColumnInt32dest 范围开始列。

例子


[C#]
CommentCollection comments = workbook.Worksheets[0].Comments;

//给A1单元格添加注释
int commentIndex = comments.Add(0, 0);
Comment comment = comments[commentIndex];
comment.Note = "First note.";
comment.Font.Name = "Times New Roman";

//给B2单元格添加注释
comments.Add("B2");
comment = comments["B2"];
comment.Note = "Second note.";

CellArea area1 = new CellArea();
area1.StartColumn = 1;
area1.StartRow = 1;
area1.EndColumn = 5;
area1.EndRow = 4;

//复制
shapes.CopyCommentsInRange(shapes, area1, 5, 1);

也可以看看