在保存为HTML时禁用旧版条件注释的显示
Contents
[
Hide
]
可能的使用场景
当将Excel文件保存为HTML时,Aspose.Cells会显示下级条件注释。这些条件注释大多与较旧版本的Internet Explorer相关,与现代Web浏览器无关。您可以在以下链接详细了解它们。
Aspose.Cells允许您通过将HtmlSaveOptions.DisableDownlevelRevealedComments属性设置为true来消除这些下级条件注释。
在保存为HTML时禁用下级可见的批注
以下示例代码展示了HtmlSaveOptions.DisableDownlevelRevealedComments属性的用法。截图显示了在未将其设置为true时此属性的效果。请下载本代码中使用的示例Excel文件以及它生成的输出HTML作为参考。
示例代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Load sample workbook | |
Workbook wb = new Workbook(sourceDir + "sampleDisableDownlevelRevealedComments.xlsx"); | |
//Disable DisableDownlevelRevealedComments | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.DisableDownlevelRevealedComments = true; | |
//Save the workbook in html | |
wb.Save(outputDir + "outputDisableDownlevelRevealedComments_true.html", opts); |