导出Excel文件为HTML时导出注释
Contents
[
Hide
]
可能的使用场景
保存Excel文件为HTML时,不会导出注释。不过,Aspose.Cells for Python via .NET 提供该功能,通过设置 HtmlSaveOptions.is_export_comments 属性,如果设为 true,HTML也会显示Excel中的注释。
在将 Excel 文件保存为 HTML 时导出批注
下面的示例代码解释了 HtmlSaveOptions.is_export_comments 属性的用法。截图展示了当它设置为 true 时代码对 HTML 的影响。请下载sample Excel file和generated HTML以供参考。
示例代码
This file contains hidden or 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
# Load the Sample Workbook | |
workbook = Workbook("Book1.xlsx") | |
# Initialize HtmlSaveOptions | |
saveOptions = HtmlSaveOptions() | |
saveOptions.is_export_comments = True | |
# Save the excel file. | |
workbook.save("outputExportCommentsHTML.html", saveOptions) |