ビルドインドキュメントプロパティを使用して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-.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); |