使用内置文档属性指定Excel文件的语言
Contents
[
Hide
]
可能的使用场景
您可以通过右键单击文件,然后选择“属性”>“详细信息”,然后编辑“语言”字段来更改Excel文件的语言。请使用Aspose.Cells API来以编程方式修改。
使用内置文档属性指定Excel文件的语言
以下示例代码创建一个工作簿并更改其名为语言的内置文档属性。请查看代码生成的输出Excel文件和截图,显示了通过Aspose.Cells API修改的语言字段。
示例代码
This file contains 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-.NET | |
//Create workbook object. | |
Workbook wb = new Workbook(); | |
//Access built-in document property collection. | |
Aspose.Cells.Properties.BuiltInDocumentPropertyCollection bdpc = wb.BuiltInDocumentProperties; | |
//Set the language of the Excel file. | |
bdpc.Language = "German, French"; | |
//Save the workbook in xlsx format. | |
wb.Save(outputDir + "outputSpecifyLanguageOfExcelFileUsingBuiltInDocumentProperties.xlsx", SaveFormat.Xlsx); |