使用内置文档属性指定 Excel 文件的文档版本
Contents
[
Hide
]
可能的使用场景
你可以改变版本号通过右键单击文件然后选择 Excel 文件属性 > 详细信息然后编辑版本号场地。请用BuiltInDocumentPropertyCollection.DocumentVersion属性以使用 Aspose.Cells API 以编程方式更改它。
使用内置文档属性指定 Excel 文件的文档版本
以下示例代码创建一个工作簿并更改其内置文档属性,其中包括标题, 作者和版本号.请参阅输出Excel文件由显示修改后的代码和屏幕截图生成版本号经过BuiltInDocumentPropertyCollection.DocumentVersion财产。
示例代码
This file contains hidden or 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-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); |