使用内置文档属性指定 Excel 文件的文档版本

可能的使用场景

你可以改变版本号通过右键单击文件然后选择 Excel 文件属性 > 详细信息然后编辑版本号场地。请用BuiltInDocumentPropertyCollection.DocumentVersion属性以使用 Aspose.Cells API 以编程方式更改它。

使用内置文档属性指定 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);