?
Solved

Which language is active?

Posted on 2006-05-16
6
Medium Priority
?
442 Views
Last Modified: 2007-12-19
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,

Luke
0
Comment
Question by:LuckyLuke57
  • 3
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 1000 total points
ID: 16689571
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."
    Else
        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"
Else
  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
bruintje
0
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 1000 total points
ID: 16689858
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
0
 
LVL 10

Author Comment

by:LuckyLuke57
ID: 16691219
bruintje,

Hello Bruintje & Graham,

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

Lucky Luke
0
 
LVL 10

Author Comment

by:LuckyLuke57
ID: 16912622
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...

Luke

0
 
LVL 10

Author Comment

by:LuckyLuke57
ID: 16951126
Both answers were very valuable.

CU folks, sorry for the waiting.

Luke
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question