ビルドインドキュメントプロパティを使用してExcelファイルの言語を指定する
Contents
[
Hide
]
可能な使用シナリオ
Excelファイルの言語を変更するには、ファイルを右クリックし、次にプロパティ > 詳細を選択してから言語フィールドを編集します。また、Aspose.CellsのAPIを使用してプログラムで変更するには、BuiltInDocumentPropertyCollection.Languageプロパティを使用してください。
ビルドインドキュメントプロパティを使用してExcelファイルの言語を指定する
次のサンプルコードは、ブックを作成し、言語という名前のビルトインドキュメントプロパティを変更します。コードによって生成された出力Excelファイルと、BuiltInDocumentPropertyCollection.Languageプロパティによって変更された言語フィールドを示すスクリーンショットをご覧ください。
サンプルコード
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-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); |