Results 1 to 6 of 6

Thread: How to get office language

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    46

    How to get office language

    Thanks problem solved
    Last edited by linguist2000; Apr 13th, 2022 at 09:50 AM.

  2. #2
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: How to get office language

    linguist

    Your question is rather ambiguous. Could you
    explain a little further what you are trying to do.

    Spoo

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2009
    Posts
    46

    Re: How to get office language

    Thanks problem solved
    Last edited by linguist2000; Apr 13th, 2022 at 09:50 AM.

  4. #4
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: How to get office language

    linguist

    Ah.. so, you want to use VB6 to do this..

    Start
    > Programs
    > Microsoft Office
    > Microsoft Office Tools
    > Microsoft Office 200x Language Settings
    .. then extract default setting from appropriate tab.

    Unfortunately, I don't know how.
    Hopefully someone else does.

    Spoo

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How to get office language

    in excel or word
    msgbox Application.LanguageSettings.LanguageID(msoLanguageIDInstall)

    will return the language id 1033 = us english
    you would need to get the language from the id


    or
    vb Code:
    1. Dim lang As MsoLanguageID
    2.  lang = Application.LanguageSettings.LanguageID(msoLanguageIDInstall)
    Last edited by westconn1; Apr 10th, 2010 at 07:28 PM.
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to get office language

    In VB6
    vb Code:
    1. ption Explicit
    2.  
    3. Private Const LOCALE_USER_DEFAULT = &H400
    4. Private Const LOCALE_SNATIVELANGNAME = &H4
    5.  
    6. Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" _
    7. (ByVal Locale As Long, _
    8. ByVal LCType As Long, _
    9. ByVal lpLCData As String, _
    10. ByVal cchData As Long) As Long
    11.  
    12. Private Function GetInfo(ByVal lInfo As Long) As String
    13.     Dim Buffer As String, Ret As String
    14.     Buffer = String$(256, 0)
    15.     Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))
    16.     If Ret > 0 Then
    17.         GetInfo = Left$(Buffer, Ret - 1)
    18.     Else
    19.         GetInfo = vbNullString
    20.     End If
    21. End Function
    22.  
    23. Private Sub Command1_Click()
    24. MsgBox GetInfo(LOCALE_SNATIVELANGNAME)
    25. End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width