ExcelをHTMLに保存しながらコメントをエクスポート

可能な使用シナリオ

ExcelファイルをHTMLに保存する際にコメントはエクスポートされませんが、Aspose.Cellsはこの機能を HtmlSaveOptions.IsExportComments プロパティで提供しています。これを true に設定すると、コメントもHTMLに表示されます。

ExcelファイルをHTMLに保存する際にコメントをエクスポート

以下のサンプルコードは、HtmlSaveOptions.IsExportComments プロパティの使い方を説明しています。スクリーンショットは、設定を true にした場合のHTMLへの影響を示しています。参考のために サンプルExcelファイル生成されたHTML をダウンロードしてください。

todo:image_alt_text

サンプルコード

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;

int main()
{
    Aspose::Cells::Startup();

    // For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C

    // Load sample Excel file
    U16String sourceDir(u"..\\Data\\01_SourceDirectory\\");
    U16String inputFilePath = sourceDir + u"sampleExportCommentsHTML.xlsx";
    Workbook workbook(inputFilePath);

    // Export comments - set IsExportComments property to true
    HtmlSaveOptions opts;
    opts.SetIsExportComments(true);

    // Save the Excel file to HTML
    U16String outputDir(u"..\\Data\\02_OutputDirectory\\");
    workbook.Save(outputDir + u"outputExportCommentsHTML.html", opts);

    std::cout << "Excel file exported to HTML with comments successfully!" << std::endl;

    Aspose::Cells::Cleanup();
}