导出Excel文件为HTML时导出注释

可能的使用场景

保存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 filegenerated HTML以供参考。

todo:image_alt_text

示例代码

# 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)