使用内置文档属性指定Excel文件的语言

可能的使用场景

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

使用内置文档属性指定Excel文件的语言

以下示例代码创建一个工作簿并更改其名为Language的内置文档属性。请查看代码生成的输出Excel文件和屏幕截图,显示由BuiltInDocumentPropertyCollection.Language属性修改的语言字段。

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 language of the Excel file.
bdpc.setLanguage("German, French");
//Save the workbook in xlsx format.
wb.save(outDir + "outputSpecifyLanguageOfExcelFileUsingBuiltInDocumentProperties.xlsx", SaveFormat.XLSX);