Excel dosyasını HTML ye kaydederken Yorumları Dışa Aktar C++ ile

Olası Kullanım Senaryoları

Excel dosyanızı HTML’ye kaydederken yorumlar dışa aktarılmaz. Ancak, Aspose.Cells bu özelliği HtmlSaveOptions.IsExportComments özelliği kullanarak sağlar. Bunu true olarak ayarlarsanız, HTML, Excel dosyanızdaki yorumları da gösterecektir.

Excel Dosyasını HTML’ye Kaydederken Yorumları Dışa Aktar

Aşağıdaki örnek kod, HtmlSaveOptions.IsExportComments özelliğinin kullanımını açıklar. Kodun etkisinin gösterildiği ekran görüntüsü, true ayarlandığında HTML üzerindedir. Referans olarak, lütfen örnek Excel dosyasını ve üretilen HTML’yi indirin.

todo:image_alt_text

Örnek Kod

#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();
}