ビルドインドキュメントプロパティを使用してExcelファイルのドキュメントバージョンを指定する
可能な使用シナリオ
Excelファイルのバージョン番号を変更するには、ファイルを右クリックして [プロパティ] > [詳細] を選択し、その後 バージョン番号 フィールドを編集します。Aspose.CellsのAPIを使用してプログラムで変更するには、BuiltInDocumentPropertyCollection.DocumentVersion プロパティを使用してください。
ビルドインドキュメントプロパティを使用してExcelファイルのドキュメントバージョンを指定する
次のサンプルコードでは、ワークブックを作成し、そのタイトル、著者、バージョン番号を含むビルトインドキュメントプロパティを変更します。そのコードで生成される出力Excelファイルと、BuiltInDocumentPropertyCollection.DocumentVersion プロパティによって変更されたバージョン番号を示すスクリーンショットを参照してください。
サンプルコード
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
//Create workbook object | |
Workbook wb = new Workbook(); | |
//Access built-in document property collection | |
Aspose.Cells.Properties.BuiltInDocumentPropertyCollection bdpc = wb.BuiltInDocumentProperties; | |
//Set the title | |
bdpc.Title = "Aspose File Format APIs"; | |
//Set the author | |
bdpc.Author = "Aspose APIs Developers"; | |
//Set the document version | |
bdpc.DocumentVersion = "Aspose.Cells Version - 18.3"; | |
//Save the workbook in xlsx format | |
wb.Save("outputSpecifyDocumentVersionOfExcelFile.xlsx", SaveFormat.Xlsx); |