ワークシート内のテーブルまたはリスト オブジェクトのコメントを設定する
Contents
[
Hide
]
を使用して、ワークシート内のテーブルまたはリスト オブジェクトのコメントを設定してください。IListObject.コメント方法。コメントは 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
For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C | |
// Instantiate a Workbook object and open an Excel file | |
intrusive_ptr<IWorkbook> workbook =Factory::CreateIWorkbook(dataDir_Tables->StringAppend(new String("source.xlsx"))); | |
// Accessing the first worksheet in the Excel file | |
intrusive_ptr<IWorksheet> worksheet = workbook->GetIWorksheets()->GetObjectByIndex(0); | |
// Get the List objects collection in the first worksheet. | |
intrusive_ptr<IListObjectCollection> listObjects = worksheet->GetIListObjects(); | |
// Set the comment of the first list object | |
listObjects->GetObjectByIndex(0)->SetComment(new String("This is Aspose.Cells comment.")); | |
// Saving the Excel file | |
workbook->Save(dataDir_Tables->StringAppend(new String("SetCommentOfTableOrListObject_out.xlsx")), SaveFormat_Xlsx); |