コメントのエクスポート(ExcelをHTMLに保存)
Contents
[
Hide
]
可能な使用シナリオ
ExcelファイルをHTMLに保存するとき、コメントはエクスポートされません。ただし、Aspose.Cells for Node.js via C++はこの機能をHtmlSaveOptions.isExportCommentsプロパティを使って提供しています。これをtrueに設定すれば、Excelファイルに含まれるコメントもHTMLに表示されるようになります。
ExcelファイルをHTMLに保存する際にコメントをエクスポート
次のサンプルコードではHtmlSaveOptions.isExportCommentsプロパティの使用方法を説明しています。コードによるHTMLへの影響を示すスクリーンショットがtrueとして設定されている場合に表示されます。参照用に、サンプルExcelファイルと生成されたHTMLをダウンロードしてください。
サンプルコード
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// Load sample Excel file
const sourceDir = path.join(__dirname, "data");
const wb = new AsposeCells.Workbook(path.join(sourceDir, "sampleExportCommentsHTML.xlsx"));
// Export comments - set IsExportComments property to true
const opts = new AsposeCells.HtmlSaveOptions();
opts.setIsExportComments(true);
// Save the Excel file to HTML
const outputDir = path.join(__dirname, "output");
wb.save(path.join(outputDir, "outputExportCommentsHTML.html"), opts);