ビルドインドキュメントプロパティを使用して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-Java | |
//Create workbook object | |
Workbook wb = new Workbook(); | |
//Access built-in document property collection | |
BuiltInDocumentPropertyCollection bdpc = wb.getBuiltInDocumentProperties(); | |
//Set the title | |
bdpc.setTitle("Aspose File Format APIs"); | |
//Set the author | |
bdpc.setAuthor("Aspose APIs Developers"); | |
//Set the document version | |
bdpc.setDocumentVersion("Aspose.Cells Version - 18.3"); | |
//Save the workbook in xlsx format | |
wb.save("outputSpecifyDocumentVersionOfExcelFile.xlsx", SaveFormat.XLSX); |