导出Excel文件为HTML时导出注释
Contents
[
Hide
]
可能的使用场景
当您将 Excel 文件保存为HTML时,注释不会被导出。但是,Aspose.Cells 提供了使用 HtmlSaveOptions.IsExportComments 属性来实现此功能。如果您将其设置为 true,那么HTML中也会显示 Excel 文件中存在的注释。
在将 Excel 文件保存为 HTML 时导出批注
下面的示例代码解释了 HtmlSaveOptions.IsExportComments 属性的用法。截图展示了当它设置为 true 时代码对 HTML 的影响。请下载sample Excel file和generated 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 Excel file | |
Workbook wb = new Workbook(sourceDir + "sampleExportCommentsHTML.xlsx"); | |
//Export comments - set IsExportComments property to true | |
HtmlSaveOptions opts = new HtmlSaveOptions(); | |
opts.IsExportComments = true; | |
//Save the Excel file to HTML | |
wb.Save(outputDir + "outputExportCommentsHTML.html", opts); |