Aspose::Cells::Drawing::ShapeCollection::CopyCommentsInRange method

ShapeCollection::CopyCommentsInRange method

Copy all comments in the range.

void Aspose::Cells::Drawing::ShapeCollection::CopyCommentsInRange(const ShapeCollection &shapes, const CellArea &ca, int32_t destRow, int32_t destColumn)
ParameterTypeDescription
shapesconst ShapeCollection&The source shapes.
caconst CellArea&The source range.
destRowint32_tThe dest range start row.
destColumnint32_tThe dest range start column.

Examples

CommentCollection comments = workbook.GetWorksheets().Get(0).GetComments();

//Add comment to cell A1
int commentIndex = comments.Add(0, 0);
Comment comment = comments.Get(commentIndex);
comment.SetNote(u"First note.");
comment.GetFont().SetName(u"Times New Roman");

//Add comment to cell B2
comments.Add("B2");
comment = comments.Get(u"B2");
comment.SetNote(u"Second note.");

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

//copy
shapeCollection.CopyCommentsInRange(shapeCollection, area1, 5, 1);

See Also