LanguagePreferences

LanguagePreferences class

允许设置语言首选项。

要了解更多信息,请访问指定加载选项文档文章。

public class LanguagePreferences

构造函数

姓名描述
LanguagePreferences()默认构造函数。

特性

姓名描述
DefaultEditingLanguage { get; set; }获取或设置默认编辑语言。

方法

姓名描述
AddEditingLanguage(EditingLanguage)添加额外的编辑语言。
AddEditingLanguages(EditingLanguage[])添加其他编辑语言。

评论

在 Word 中实现“设置 Office 语言首选项”对话框。

例子

演示如何在加载文档时应用语言首选项。

LoadOptions loadOptions = new LoadOptions();
loadOptions.LanguagePreferences.AddEditingLanguage(EditingLanguage.Japanese);

Document doc = new Document(MyDir + "No default editing language.docx", loadOptions);

int localeIdFarEast = doc.Styles.DefaultFont.LocaleIdFarEast;
Console.WriteLine(localeIdFarEast == (int)EditingLanguage.Japanese
    ? "The document either has no any FarEast language set in defaults or it was set to Japanese originally."
    : "The document default FarEast language was set to another than Japanese language originally, so it is not overridden.");

也可以看看