Private Declare Function GetThreadLocale Lib "kernel32" () As Long
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Declare Function GetLocaleInfo Lib "kernel32" _
Alias "GetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long
Const LOCALE_SENGLANGUAGE As Long = &H1001 'English name of lang
Dim LCID As Long
'---------------------------------------------------------------------------
Public Function GetUserLocaleInfo(ByVal dwLocaleID As Long, ByVal dwLCType
As Long) _
As String
'---------------------------------------------------------------------------
Dim sReturn As String
Dim r As Long
r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
'if successful..
If r Then
sReturn = Space$(r)
r = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, Len(sReturn))
If r Then
GetUserLocaleInfo = Left$(sReturn, r - 1)
End If
End If
End Function
'---------------------------------------------------------------------------
Public Function LanguageName() As String
'---------------------------------------------------------------------------
LCID = GetSystemDefaultLCID()
LanguageName = GetUserLocaleInfo(LCID, LOCALE_SENGLANGUAGE)
End Function
--
HTH
RP
(remove nothere from the email address if mailing direct)