Class Comment
Represents a comment in a cell.
Inheritance
Namespace: IronXL.Cells
Assembly: IronXL.dll
Syntax
public class Comment : Object
Comment is the note attached to a single spreadsheet cell, the kind a reviewer leaves to explain a value or flag a question. It holds the comment's text, who wrote it, the cell it belongs to, and whether it shows on the sheet, so a developer can read or adjust an annotation without touching the cell's own data.
Work with a comment through the cell it sits on, then read or set its properties. Content holds the comment text and Author records who left it. Address reports the address of the cell that carries the comment and is read-only, so it identifies the location rather than moving the note. IsVisible controls whether the comment is shown directly on the worksheet; comments are hidden by default and surface on hover until this is turned on. Setting IsVisible to true pins a note open, which suits callouts a reader should not have to hunt for. Each property reads and writes plain values, so updating an annotation is a direct assignment.
// comment obtained from a cell
comment.Author = "Reviewer";
comment.Content = "Check this figure";
comment.IsVisible = true;The add a comment how-to covers creating and editing cell comments, and the edit an Excel file how-to sets the cell values a comment annotates.
Properties
Address
Gets the address of the cell that contains this Comment.
Declaration
public string Address { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Author
Gets or sets the author of the comment.
Declaration
public string Author { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Content
Gets or sets the content of the comment.
Declaration
public string Content { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
IsVisible
Gets or sets a value indicating whether the comment is visible. Comments are hidden by default.
Declaration
public bool IsVisible { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |