試試這個:
Range cell = (Range)sheet.Cells[1, 1];
Comment comment = cell.AddComment("blah");
comment.Shape.TextFrame.AutoSize = true;
編輯:較長的文本和不同的方法:
string text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit,\n sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n"+
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris\n nisi ut aliquip ex ea commodo consequat."+
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n"+
"Excepteur sint occaecat cupidatat non proident, sunt in \nculpa qui officia deserunt mollit anim id est laborum";
Range cell = (Range)sheet.Cells[1, 1];
Comment comment = cell.AddComment();
comment.Shape.TextFrame.AutoSize = true;
comment.Text(text);
謝謝 - 這正是我一直在尋找的。 – TVOHM