TXlsFile.CommentCountRow Method
Number of comments on a given row.
Remarks
There are 2 groups of Comment related methods. One is used when you want to find out on a loop all existing comments on a range, and the other is used to get/set comments at a specified position (row and col). To loop among all existing comments, you can use TExcelFile.CommentRowCount together with CommentCountRow. Do not confuse them, even when they have similar names. TExcelFile.CommentRowCount returns the maximum row with a comment, and CommentCountRow returns the number of comments in a given row.
Syntax
Unit: FlexCel.XlsAdapter
function TXlsFile.CommentCountRow(const row: Integer): Integer; override;
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
const | row | Integer | Row index (1 based) |
Returns
The number of comments on a given row.
Examples
You can loop on all the comments on a sheet with the following code:
var
row: Int32;
commentIndex: Int32;
...
for row := 1 to xls.CommentRowCount do
begin
for commentIndex := 1 to xls.CommentCountRow(row) do
begin
DoSomething(xls.GetCommentRow(row, commentIndex));
end;
end;
See also
- TXlsFile
- TExcelFile.CommentRowCount
- TExcelFile.GetCommentRow
- TExcelFile.GetCommentRowCol
- TExcelFile.GetComment
- TExcelFile.SetCommentRow(Integer, Integer, string, IImageProperties, Boolean)
- TExcelFile.SetComment(Integer, Integer, TRichString)
- TExcelFile.GetCommentPropertiesRow
- TExcelFile.SetCommentPropertiesRow
- TExcelFile.SetCommentProperties