|
-
Apr 10th, 2010, 02:36 PM
#1
Thread Starter
Member
How to get office language
Last edited by linguist2000; Apr 13th, 2022 at 09:50 AM.
-
Apr 10th, 2010, 03:04 PM
#2
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
-
Apr 10th, 2010, 03:09 PM
#3
Thread Starter
Member
Re: How to get office language
Last edited by linguist2000; Apr 13th, 2022 at 09:50 AM.
-
Apr 10th, 2010, 03:21 PM
#4
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
-
Apr 10th, 2010, 07:08 PM
#5
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:
Dim lang As MsoLanguageID 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
-
Apr 11th, 2010, 07:06 AM
#6
Re: How to get office language
In VB6
vb Code:
ption Explicit
Private Const LOCALE_USER_DEFAULT = &H400
Private Const LOCALE_SNATIVELANGNAME = &H4
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
Private Function GetInfo(ByVal lInfo As Long) As String
Dim Buffer As String, Ret As String
Buffer = String$(256, 0)
Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))
If Ret > 0 Then
GetInfo = Left$(Buffer, Ret - 1)
Else
GetInfo = vbNullString
End If
End Function
Private Sub Command1_Click()
MsgBox GetInfo(LOCALE_SNATIVELANGNAME)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|