Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    May 2006
    Location
    Currently in Europe
    Posts
    103
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Word 2010 VBA get language name style.languageID number

    I want to use a macro to check the language settings for styles. Using style.languageID returns a number.

    I want the NAME of the language.

    I have found this code in stackoverflow:

    Sub LanguageMessageBox()

    CurrentLanguage = Selection.LanguageID
    MsgBox (Languages(CurrentLanguage))

    End Sub

    This bit of code will display for example "English" or whatever, but only for selected text.
    If I change the code from Selection.LanguageID to Style.LanguageID, then the MsgBox doesn't even display!

    How can I get vba to translate the decimal code number of the language to plain English?

    Any suggestions welcome...
    Stylus

  2. #2
    2 Star Lounger
    Join Date
    May 2006
    Location
    Currently in Europe
    Posts
    103
    Thanks
    7
    Thanked 0 Times in 0 Posts
    nevermind...

    Figured it out:

    With style etc
    CurrentLanguage = Languages(Selection.LanguageID)
    Stylus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •