Getting the language of Office
by Michael S. Kaplan, published on 2006/01/17 05:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/01/17/513651.aspx
Sunil Virami asked in the microsoft.public.win32.programmer.international newsgroup:
Is it possible to find out which language version of MS office is installed on the current system.
i.e whether it is japanese office, english office, chinese office or some other language.
How can i find it out using the code ?
There is actually a property that was added to the Application object of all of the Office applications back in the Office 2000 timeframe -- the LanguageSettings property. It returns a copy of the LanguageSettings object which can be used to retrieve any of the following:
- Application.LanguageSettings.LanguagePreferredForEditing(msoLanguageID) -- Returns True if the value for the msoLanguageID constant has been identified in the Windows registry as a preferred language for editing (you must test all valid msoLanguageID values to enumerate the set of preferred languages.).
- Application.LanguageSettings.LanguageID(msoLanguageIDExeMode) -- The language mode that the application is using. This setting applies only to Microsoft Excel and Microsoft Access. This setting affects languages that can be displayed and edited, available language-specific features, number styles, currency settings, and so forth. If none of the languages supported by Excel and Access are used, the host application will not be configured to support right-to-left and East Asian languages. The supported languages are as follows: Arabic, Farsi, Hebrew, Japanese, Korean, Simplified Chinese, Traditional Chinese, Urdu, Yiddish.
- Application.LanguageSettings.LanguageID(msoLanguageIDHelp) -- The language used for online Help.
- Application.LanguageSettings.LanguageID(msoLanguageIDInstall) -- The language settings used by Microsoft Office to set up defaults. For example, Microsoft Word uses this setting to determine the layout of toolbars and the default types of bullets and numbers on a language-by-language basis.
- Application.LanguageSettings.LanguageID(msoLanguageIDUI) -- The language used by the host application's user interface.
- Application.LanguageSettings.LanguageID(msoLanguageIDUIPrevious) -- The language setting for the user interface when a given computer was last rebooted. A program or add-in can use this to determine whether the user interface language has changed.
Pretty much more than you ever needed to know about the language version of Office (though the heavy dependence on LCIDs is a little disappointing; we'll need to work on that!).
This post brought to you by "O" (U+004f, a.k.a. LATIN CAPITAL LETTER O)
# Luke Amery on 17 Jan 2006 10:59 PM:
Pardon my ignorance, but why so down on LCIDs? is it a human readable thing? or is there a technical problem with them - like ELKs don't use them or some such?
# Michael S. Kaplan on 17 Jan 2006 11:45 PM:
I would not call it ignorance. There are lots of problems with LCIDs, like their proprietary nature and the lack of extensibility (plus we are running out of room -- see http://blogs.msdn.com/michkap/383458.aspx
for more on that issue!).
In the long run, we need people to move away from them to deal with all of the issues.
Please consider a donation
to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.
go to newer or older post, or back to index or month or day