// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IComment commentC3 = worksheet.getRange("C3").addComment("Range C3's comment."); commentC3.getShape().getLine().getColor().setRGB(Color.GetLightGreen()); commentC3.getShape().getLine().setWeight(3); commentC3.getShape().getLine().setStyle(LineStyle.ThickThin); commentC3.getShape().getLine().setDashStyle(LineDashStyle.Solid); commentC3.getShape().getFill().getColor().setRGB(Color.GetPink()); commentC3.getShape().setWidth(100); commentC3.getShape().setHeight(200); commentC3.getShape().getTextFrame().getTextRange().getFont().setBold(true); commentC3.setVisible(true); // Save to an excel file workbook.save("ConfigCommentLayout.xlsx");
// Create a new workbook var workbook = Workbook() val worksheet = workbook.worksheets.get(0) val commentC3 = worksheet.getRange("C3").addComment("Range C3's comment.") commentC3.shape.line.color.rgb = Color.GetLightGreen() commentC3.shape.line.weight = 3.0 commentC3.shape.line.style = LineStyle.ThickThin commentC3.shape.line.dashStyle = LineDashStyle.Solid commentC3.shape.fill.color.rgb = Color.GetPink() commentC3.shape.width = 100.0 commentC3.shape.height = 200.0 commentC3.shape.textFrame.textRange.font.bold = true commentC3.visible = true // Save to an excel file workbook.save("ConfigCommentLayout.xlsx")