Disable Downlevel Revealed Comments while saving to HTML with C++

Possible Usage Scenarios

When you save your Excel file to HTML, Aspose.Cells reveals Downlevel Conditional Comments. These conditional comments are mostly relevant to older versions of Internet Explorer and are irrelevant to modern Web Browsers. You can read about them in detail at the following link.

Aspose.Cells allows you to eliminate these Downlevel Revealed Comments by setting the HtmlSaveOptions.GetDisableDownlevelRevealedComments() property to true.

Disable Downlevel Revealed Comments while saving to HTML

The following sample code shows the usage of HtmlSaveOptions.GetDisableDownlevelRevealedComments() property. The screenshot shows the effect of this property when it is not set to true. Please download the sample Excel file used in this code and the output HTML generated by it for a reference.

todo:image_alt_text

Sample Code

#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 workbook
    U16String sourceDir(u"..\\Data\\01_SourceDirectory\\");
    U16String outputDir(u"..\\Data\\02_OutputDirectory\\");
    
    Workbook wb(sourceDir + u"sampleDisableDownlevelRevealedComments.xlsx");

    // Disable DisableDownlevelRevealedComments
    HtmlSaveOptions opts;
    opts.SetDisableDownlevelRevealedComments(true);

    // Save the workbook in html
    wb.Save(outputDir + u"outputDisableDownlevelRevealedComments_true.html", opts);

    std::cout << "Workbook saved successfully with DisableDownlevelRevealedComments enabled!" << std::endl;

    Aspose::Cells::Cleanup();
}