单元格注释的字符串格式 EPPLUS 库

String formatting of cell comments EPPLUS library

使用EPPLUS创建.xlsx文件时是否可以格式化注释? 据我所知,唯一的方法是:
ExcelComment AddComment(string Text, string Author);

这个库的注释是否有其他已知的限制?
如果是,.net 中是否有更好的选择?

事实证明,我过早地认为 EPPLUS 受到限制是错误的

评论格式

AddComment 方法创建了对象并 returns 它。这样您就可以使用 RichTextCollectionExcelComment 中编辑对象

本例将单元格注释的一部分加粗:

ExcelComment commento = wItem.AddComment(null, "Sys");
commento.RichText.RemoveAt(0);
ExcelRichText ert = commento.RichText.Add(dataItem.Commento[0]);
ert.Bold = true;
ert = commento.RichText.Add(dataItem.Commento[1]);
ert.Bold = false;


截断

至于截断,由于评论气泡的尺寸,起初看不到它。
使用自动调整 属性

wItem.Comment.AutoFit = true;