Which language is active?

Hello experts,

I need a macro to show which language is active in the documents' spelling checker, and if the hyphenation of that language is active??

Thanks a lot,

LVL 10
Who is Participating?
Hello LuckyLuke57,

there is some info in the word vba help about language detection in word from which this sample came
With ActiveDocument
    If .Range.LanguageID = wdEnglishUS Then
        MsgBox "This is a U.S. English document."
        MsgBox "This is not a U.S. English document."
    End If
End With

of for the current selection you're typing

If Selection.LanguageID = wdEnglishUS Then
  MsgBox "Spell check is currently set to U.S. English"
  MsgBox "Spell check is currently set to another language then U.S. English"
End If

the wdLanguageId's are found in the object browser [F2] in the vb editor

If ActiveDocument.Styles("Normal").ParagraphFormat.Hyphenation then
  MsgBox "Hyphenation is active for paragrpahs with a style of normal"
End If

hope this helps a bit
You might also like to use this function to return the language in text form:

Function GetLanguageDescription(LangID As Long) As String
    Dim strLanguage As String
    Select Case LangID
        Case wdAfrikaans
            strLanguage = "Afrikaans "
        Case wdAlbanian
            strLanguage = "Albanian"
        Case wdArabic
            strLanguage = "Arabic"
        Case wdArabicAlgeria
            strLanguage = "Arabic Algeria"
        Case wdArabicBahrain
            strLanguage = "Arabic Bahrain"
        Case wdArabicEgypt
            strLanguage = "Arabic Egypt"
        Case wdArabicIraq
            strLanguage = "Arabic Iraq"
        Case wdArabicJordan
            strLanguage = "Arabic Jordan"
        Case wdArabicKuwait
            strLanguage = "Arabic Kuwait"
        Case wdArabicLebanon
            strLanguage = "Arabic Lebanon"
        Case wdArabicLibya
            strLanguage = "Arabic Libya"
        Case wdArabicMorocco
            strLanguage = "Arabic Morocco"
        Case wdArabicOman
            strLanguage = "Arabic Oman"
        Case wdArabicQatar
            strLanguage = "Arabic Qatar"
        Case wdArabicSyria
            strLanguage = "Arabic Syria"
        Case wdArabicTunisia
            strLanguage = "Arabic Tunisia"
        Case wdArabicUAE
            strLanguage = "Arabic UAE"
        Case wdArabicYemen
            strLanguage = "Arabic Yemen"
        Case wdArmenian
            strLanguage = "Armenian"
        Case wdAssamese
            strLanguage = "Assamese"
        Case wdAzeriCyrillic
            strLanguage = "Azeri Cyrillic"
        Case wdAzeriLatin
            strLanguage = "Azeri Latin"
        Case wdBasque
            strLanguage = "Basque"
        Case wdBelgianDutch
            strLanguage = "Belgian Dutch"
        Case wdBelgianFrench
            strLanguage = "Belgian French"
        Case wdBengali
            strLanguage = "Bengali"
        'Case wdBosniaHerzegovina
            'strLanguage = "Bosnia-Herzegovina"
        Case wdBrazilianPortuguese
            strLanguage = "Brazilian Portuguese"
        Case wdBulgarian
            strLanguage = "Bulgarian"
        Case wdBurmese
            strLanguage = "Burmese"
        Case wdByelorussian
            strLanguage = "Byelorussian"
        Case wdCatalan
            strLanguage = "Catalan"
        Case wdChineseHongKong
            strLanguage = "Chinese Hong Kong"
        Case wdChineseMacao
            strLanguage = "Chinese Macao"
        Case wdChineseSingapore
            strLanguage = "Chinese Singapore"
        Case wdCroatian
            strLanguage = "Croatian"
        Case wdCzech
            strLanguage = "Czech"
        Case wdDanish
            strLanguage = "Danish"
        Case wdDutch
            strLanguage = "Dutch"
        Case wdEnglishAUS
            strLanguage = "English AUS"
        Case wdEnglishBelize
            strLanguage = "English Belize"
        Case wdEnglishCanadian
            strLanguage = "English Canadian"
        Case wdEnglishCaribbean
            strLanguage = "English Caribbean"
        Case wdEnglishIreland
            strLanguage = "English Ireland"
        Case wdEnglishJamaica
            strLanguage = "English Jamaica"
        Case wdEnglishNewZealand
            strLanguage = "English NewZealand"
        Case wdEnglishPhilippines
            strLanguage = "English Philippines"
        Case wdEnglishSouthAfrica
            strLanguage = "English SouthAfrica"
        Case wdEnglishTrinidad
            strLanguage = "English Trinidad"
        Case wdEnglishUK
            strLanguage = "English UK"
        Case wdEnglishUS
            strLanguage = "English US"
        Case wdEnglishZimbabwe
            strLanguage = "English Zimbabwe"
        Case wdEstonian
            strLanguage = "Estonian"
        Case wdFaeroese
            strLanguage = "Faeroese"
        Case wdFarsi
            strLanguage = "Farsi"
        Case wdFinnish
            strLanguage = "Finnish"
        Case wdFrench
            strLanguage = "French"
        Case wdFrenchCameroon
            strLanguage = "French Cameroon"
        Case wdFrenchCanadian
            strLanguage = "French Canadian"
        Case wdFrenchCotedIvoire
            strLanguage = "French Cote d'Ivoire"
        Case wdFrenchLuxembourg
            strLanguage = "French Luxembourg"
        Case wdFrenchMali
            strLanguage = "French Mali"
        Case wdFrenchMonaco
            strLanguage = "French Monaco"
        Case wdFrenchReunion
            strLanguage = "French Reunion"
        Case wdFrenchSenegal
            strLanguage = "French Senegal"
        Case wdFrenchWestIndies
            strLanguage = "French West Indies"
        Case wdFrenchZaire
            strLanguage = "French Zaire"
        Case wdFrisianNetherlands
            strLanguage = "Frisian Netherlands"
        Case wdGaelicIreland
            strLanguage = "Gaelic Ireland"
        Case wdGaelicScotland
            strLanguage = "Gaelic Scotland"
        Case wdGalician
            strLanguage = "Galician"
        Case wdGeorgian
            strLanguage = "Georgian"
        Case wdGerman
            strLanguage = "German"
        Case wdGermanAustria
            strLanguage = "German Austria"
        Case wdGermanLiechtenstein
            strLanguage = "German iechtenstein"
        Case wdGermanLuxembourg
            strLanguage = "German Luxembourg"
        Case wdGreek
            strLanguage = "Greek"
        Case wdGujarati
            strLanguage = "Gujarati"
        Case wdHebrew
            strLanguage = "Hebrew"
        Case wdHindi
            strLanguage = "Hindi"
        Case wdHungarian
            strLanguage = "Hungarian"
        Case wdIcelandic
            strLanguage = "Icelandic"
        Case wdIndonesian
            strLanguage = "Indonesian"
        Case wdItalian
            strLanguage = "Italian"
        Case wdJapanese
            strLanguage = "Japanese"
        Case wdKannada
            strLanguage = "Kannada"
        Case wdKashmiri
            strLanguage = "Kashmiri"
        Case wdKazakh
            strLanguage = "Kazakh"
        Case wdKhmer
            strLanguage = "Khmer "
        Case wdKirghiz
            strLanguage = "Kirghiz"
        Case wdKonkani
            strLanguage = "Konkani"
        Case wdKorean
            strLanguage = "Korean"
        Case wdLanguageNone
            strLanguage = "Language None"
        Case wdLao
            strLanguage = "Lao"
        Case wdLatvian
            strLanguage = "Latvian"
        Case wdLithuanian
            strLanguage = "Lithuanian"
        'Case wdLithuanianClassic
            'strLanguage = "Lithuanian Classic"
        Case wdMacedonian
            strLanguage = "Macedonian"
        Case wdMalayalam
            strLanguage = "Malayalam"
        Case wdMalayBruneiDarussalam
            strLanguage = "Malay Brunei Darussalam"
        Case wdMalaysian
            strLanguage = "Malaysian"
        Case wdMaltese
            strLanguage = "Maltese"
        Case wdManipuri
            strLanguage = "Manipuri"
        Case wdMarathi
            strLanguage = "Marathi"
        Case wdMexicanSpanish
            strLanguage = "Mexican Spanish"
        Case wdMongolian
            strLanguage = "Mongolian"
        Case wdNepali
            strLanguage = "Nepali"
        Case wdNoProofing
            strLanguage = "No Proofing"
        Case wdNorwegianBokmol
            strLanguage = "Norwegian Bokmol"
        Case wdNorwegianNynorsk
            strLanguage = "Norwegian Nynorsk"
        Case wdOriya
            strLanguage = "Oriya"
        Case wdPolish
            strLanguage = "Polish"
        Case wdPortuguese
            strLanguage = "Portuguese"
        Case wdPunjabi
            strLanguage = "Punjabi"
        Case wdRhaetoRomanic
            strLanguage = "Rhaeto Romanic"
        Case wdRomanian
            strLanguage = "Romanian"
        Case wdRomanianMoldova
            strLanguage = "Romanian Moldova"
        Case wdRussian
            strLanguage = "Russian"
        Case wdRussianMoldova
            strLanguage = "Russian Moldova"
        Case wdSamiLappish
            strLanguage = "Sami Lappish"
        Case wdSanskrit
            strLanguage = "Sanskrit"
        Case wdSerbianCyrillic
            strLanguage = "Serbian Crillic"
        Case wdSerbianLatin
            strLanguage = "Serbian Latin"
        Case wdSesotho
            strLanguage = "Sesotho"
        Case wdSimplifiedChinese
            strLanguage = "Simplified Chinese"
        Case wdSindhi
            strLanguage = "Sindhi"
        Case wdSlovak
            strLanguage = "Slovak"
        Case wdSlovenian
            strLanguage = "Slovenian"
        Case wdSorbian
            strLanguage = "Sorbian"
        Case wdSpanish
            strLanguage = "Spanish"
        Case wdSpanishArgentina
            strLanguage = "Spanish Argentina"
        Case wdSpanishBolivia
            strLanguage = "Spanish Bolivia"
        Case wdSpanishChile
            strLanguage = "Spanish Chile"
        Case wdSpanishColombia
            strLanguage = "Spanish Colombia"
        Case wdSpanishCostaRica
            strLanguage = "Spanish Costa Rica"
        Case wdSpanishDominicanRepublic
            strLanguage = "Spanis Dominican Republic"
        Case wdSpanishEcuador
            strLanguage = "Spanish Ecuador"
        Case wdSpanishElSalvador
            strLanguage = "Spanish El Salvador"
        Case wdSpanishGuatemala
            strLanguage = "Spanish Guatemala"
        Case wdSpanishHonduras
            strLanguage = "Spanish Honduras"
        Case wdSpanishModernSort
            strLanguage = "Spanish Modern Sort"
        Case wdSpanishNicaragua
            strLanguage = "Spanish Nicaragua"
        Case wdSpanishPanama
            strLanguage = "Spanish Panama"
        Case wdSpanishParaguay
            strLanguage = "Spanish Paraguay"
        Case wdSpanishPeru
            strLanguage = "Spanish Peru"
        Case wdSpanishPuertoRico
            strLanguage = "Spanish Puerto Rico"
        Case wdSpanishUruguay
            strLanguage = "Spanish Uruguay"
        Case wdSpanishVenezuela
            strLanguage = "Spanish Venezuela"
        Case wdSutu
            strLanguage = "Sutu"
        Case wdSwahili
            strLanguage = "Swahili"
        Case wdSwedish
            strLanguage = "Swedish"
        Case wdSwedishFinland
            strLanguage = "Swedish Finland"
        Case wdSwissFrench
            strLanguage = "Swiss French"
        Case wdSwissGerman
            strLanguage = "Swiss German"
        Case wdSwissItalian
            strLanguage = "Swiss Italian"
        Case wdTajik
            strLanguage = "Tajik"
        Case wdTamil
            strLanguage = "Tamil"
        Case wdTatar
            strLanguage = "Tatar"
        Case wdTelugu
            strLanguage = "Telugu"
        Case wdThai
            strLanguage = "Thai"
        Case wdTibetan
            strLanguage = "Tibetan"
        Case wdTraditionalChinese
            strLanguage = "Traditional Chinese"
        Case wdTsonga
            strLanguage = "Tsonga"
        Case wdTswana
            strLanguage = "Tswana"
        Case wdTurkish
            strLanguage = "Turkish"
        Case wdTurkmen
            strLanguage = "Turkmen"
        Case wdUkrainian
            strLanguage = "Ukrainian"
        Case wdUrdu
            strLanguage = "Urdu"
        Case wdUzbekCyrillic
            strLanguage = "Uzbek Cyrillic"
        Case wdUzbekLatin
            strLanguage = "Uzbek Latin"
        Case wdVenda
            strLanguage = "Venda"
        Case wdVietnamese
            strLanguage = "Vietnamese"
        Case wdWelsh
            strLanguage = "Welsh"
        Case wdXhosa
            strLanguage = "Xhosa"
        Case wdZulu
            strLanguage = "Zulu"
        Case 9999999
            strLanguage = "Mixed Languages"
    End Select
    GetLanguageDescription = strLanguage
End Function
LuckyLuke57Author Commented:

Hello Bruintje & Graham,

I come back to that tomorrow.
Seems to be good, don't have time to test & grant points.

Lucky Luke
LuckyLuke57Author Commented:
Sorry, I missed this one!!!

I forgot to come back to this question, and then I went in vacation for almost a month.
Give me the chance to investigate the answers next tuesday, and then I will decide how to give points.

So administrator: don't take any action for the moment...


LuckyLuke57Author Commented:
Both answers were very valuable.

CU folks, sorry for the waiting.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.