全部显示

LanguageID 属性

       

返回或设置指定对象的语言。WdLanguageID,可读写。

expression.LanguageID

expression   必需。该表达式返回“应用于”列表中的一个对象。

说明

对于自定义词典,指定 LanguageID 属性前,必需先将 LanguageSpecific 属性设为 True。特定语言的自定义词典只能查询符合该语言格式的文本。

由于您选择或安装的语言支持不同,例如,英语(美国),上述部分常量可能无法使用。

示例

本示例将活动文档的第二段格式设置为法语格式,然后添加新的自定义词典,此词典用于查阅法语文本。

ActiveDocument.Paragraphs(2).Range.LanguageID = wdFrench
Set myDictionary = CustomDictionaries.Add(Filename:="French.dic")
With myDictionary
    .LanguageSpecific = True
    .LanguageID = wdFrench
End With

本示例将 Title 样式重定义为使用西班牙语校对工具,然后在一个消息框中显示有关新样式的说明。

ActiveDocument.Styles("Title").LanguageID = wdSpanish
MsgBox ActiveDocument.Styles("Title").Description