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

可能的使用场景

您可以通过右键单击文件,然后选择属性 > 详细信息,并编辑版本号字段来更改Excel文件的版本号。请使用BuiltInDocumentPropertyCollection.DocumentVersion属性使用Aspose.Cells API以编程方式更改版本号。

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

以下示例代码创建一个工作簿并更改其包括标题作者版本号在内的内置文档属性。请查看代码生成的输出Excel文件和屏幕截图,显示由BuiltInDocumentPropertyCollection.DocumentVersion属性修改的版本号

todo:image_alt_text

示例代码

// 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);