Syncfusion.XlsIO.Base
Example 


Comment Property (IRange)

Gets a ICommentShape object that represents the comment associated with the range. Read-only.
Syntax
'Declaration
 
ReadOnly Property Comment As ICommentShape
'Usage
 
Dim instance As IRange
Dim value As ICommentShape
 
value = instance.Comment
ICommentShape Comment {get;}
Example
The following code illustrates how to insert Comments property of the Range.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
            
IWorksheet sheet = workbook.Worksheets[0];
// Adding comments to a cell.
sheet.Range["A1"].AddComment().Text = "Comments";
            
// Add Rich Text Comments.
IRange range = sheet.Range["A6"];
range.AddComment().RichText.Text = "RichText";
IRichTextString rtf = range.Comment.RichText;
            
// Formatting first 4 characters.
IFont redFont = workbook.CreateFont();
redFont.Bold = true;
redFont.Color = ExcelKnownColors.Red;
rtf.SetFont(0, 3, redFont);
            
workbook.SaveAs("Comments.xlsx");
workbook.Close();
excelEngine.Dispose();
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also