使用Node.js与C++设置工作表中表或列表对象的注释
Contents
[
Hide
]
你可以使用ListObject.getComment()属性设置工作表中表或列表对象的注释,注释将显示在xl/tables/tableName.xml文件中。
设置工作表内表格或列表对象的批注
以下示例代码加载源Excel文件,设置工作表中第一个表格或列表对象的注释。
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Open the template file.
const workbook = new AsposeCells.Workbook(path.join(dataDir, "table_comment.xlsx"));
// Access first worksheet.
const worksheet = workbook.getWorksheets().get(0);
// Access first list object or table.
const lstObj = worksheet.getListObjects().get(0);
// Set the comment of the list object
lstObj.setComment("This is Aspose.Cells comment.");
// Save the workbook in xlsx format
workbook.save(path.join(dataDir, "SetCommentOfTableOrListObject_out.xlsx"), AsposeCells.SaveFormat.Xlsx);