テーブルまたはリストオブジェクトのコメントを設定する
Contents
[
Hide
]
ワークシート内のテーブルまたはリストオブジェクトのコメントを設定してください
Aspose.Cells for Python via Javaでは、リストオブジェクトのコメントを追加することができます。このために、APIはListObject.Commentプロパティを提供しています。ListObject.Commentプロパティによって追加されたコメントは、xl/tables/tableName.xmlファイル内で表示されます。
以下のスクリーンショットは、サンプルコードによって作成されたコメントを赤い四角で示しています。
以下のサンプルコードは、ソースExcelファイルをロードし、ワークシート内の最初のテーブルまたはリストオブジェクトのコメントを設定しています。
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
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
workbook = Workbook(source_directory + "source.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Access first list object or table | |
listObj = worksheet.getListObjects().get(0) | |
# Set the comment of the list object | |
listObj.setComment("This is Aspose.Cells comment.") | |
# Save the excel file. | |
workbook.save(output_directory + "STheCofTOrListObject_out.xlsx") |