Word VBA教程:LanguageID属性

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

WdLanguageID 可以是下列 WdLanguageID 常量之一:
wdAfrikaans
wdAlbanian
wdAmharic
wdArabic
wdArabicAlgeria
wdArabicBahrain
wdArabicEgypt
wdArabicIraq
wdArabicJordan
wdArabicKuwait
wdArabicLebanon
wdArabicLibya
wdArabicMorocco
wdArabicOman
wdArabicQatar
wdArabicSyria
wdArabicTunisia
wdArabicUAE
wdArabicYemen
wdArmenian
wdAssamese
wdAzeriCyrillic
wdAzeriLatin
wdBasque
wdBelgianDutch
wdBelgianFrench
wdBengali
wdBrazilianPortuguese
wdBulgarian
wdBurmese
wdByelorussian
wdCatalan
wdCherokee
wdChineseHongKong
wdChineseMacao
wdChineseSingapore
wdCroatian
wdCzech
wdDanish
wdDivehi
wdDutch
wdEdo
wdEnglishAUS
wdEnglishBelize
wdEnglishCanadian
wdEnglishCaribbean
wdEnglishIreland
wdEnglishJamaica
wdEnglishNewZealand
wdEnglishPhilippines
wdEnglishSouthAfrica
wdEnglishTrinidad
wdEnglishUK
wdEnglishUS
wdEnglishZimbabwe
wdEstonian
wdFaeroese
wdFarsi
wdFilipino
wdFinnish
wdFrench
wdFrenchCameroon
wdFrenchCanadian
wdFrenchCotedIvoire
wdFrenchLuxembourg
wdFrenchMali
wdFrenchMonaco
wdFrenchReunion
wdFrenchSenegal
wdFrenchWestIndies
wdFrenchZaire
wdFrisianNetherlands
wdFulfulde
wdGaelicIreland
wdGaelicScotland
wdGalician
wdGeorgian
wdGerman
wdGermanAustria
wdGermanLiechtenstein
wdGermanLuxembourg
wdGreek
wdGuarani
wdGujarati
wdHausa
wdHawaiian
wdHebrew
wdHindi
wdHungarian
wdIbibio
wdIcelandic
wdIgbo
wdIndonesian
wdInuktitut
wdItalian
wdJapanese
wdKannada
wdKanuri
wdKashmiri
wdKazakh
wdKhmer
wdKirghiz
wdKonkani
wdKorean
wdKyrgyz
wdLanguageNone
wdLao
wdLatin
wdLatvian
wdLithuanian
wdMacedonian
wdMalayalam
wdMalayBruneiDarussalam
wdMalaysian
wdMaltese
wdManipuri
wdMarathi
wdMexicanSpanish
wdMongolian
wdNepali
wdNoProofing
wdNorwegianBokmol
wdNorwegianNynorsk
wdOriya
wdOromo
wdPashto
wdPolish
wdPortuguese
wdPunjabi
wdRhaetoRomanic
wdRomanian
wdRomanianMoldova
wdRussian
wdRussianMoldova
wdSamiLappish
wdSanskrit
wdSerbianCyrillic
wdSerbianLatin
wdSesotho
wdSimplifiedChinese
wdSindhi
wdSindhiPakistan
wdSinhalese
wdSlovak
wdSlovenian
wdSomali
wdSorbian
wdSpanish
wdSpanishArgentina
wdSpanishBolivia
wdSpanishChile
wdSpanishColombia
wdSpanishCostaRica
wdSpanishDominicanRepublic
wdSpanishEcuador
wdSpanishElSalvador
wdSpanishGuatemala
wdSpanishHonduras
wdSpanishModernSort
wdSpanishNicaragua
wdSpanishPanama
wdSpanishParaguay
wdSpanishPeru
wdSpanishPuertoRico
wdSpanishUruguay
wdSpanishVenezuela
wdSutu
wdSwahili
wdSwedish
wdSwedishFinland
wdSwissFrench
wdSwissGerman
wdSwissItalian
wdSyriac
wdTajik
wdTamazight
wdTamazightLatin
wdTamil
wdTatar
wdTelugu
wdThai
wdTibetan
wdTigrignaEritrea
wdTigrignaEthiopic
wdTraditionalChinese
wdTsonga
wdTswana
wdTurkish
wdTurkmen
wdUkrainian
wdUrdu
wdUzbekCyrillic
wdUzbekLatin
wdVenda
wdVietnamese
wdWelsh
wdXhosa
wdYi
wdYiddish
wdYoruba
wdZulu

expression.LanguageID

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

说明

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

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

VBA示例

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


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

Word VBA教程

Word VBA参考教程:目录1 Word VBA参考教程:目录2
Word VBA参考教程:目录3 Word VBA参考教程:目录4
Word VBA参考教程:目录5 Word VBA参考教程:目录6
Word VBA参考教程:目录7 Word VBA参考教程:目录8
Word VBA参考教程:目录9 Word VBA参考教程:目录10
版权所有 © 中山市飞娥软件工作室 证书:粤ICP备09170368号