I recently supplied an answer to a question I stumbled across on stackoverflow.com. Because the information may be useful to someone, I’ve decided to share my response here as well.

The question the user had is how he could detect the locale Outlook was running in.

The answer I provided can be found below.

There are a number of ways you can go about doing this. Although the exact process depends on the Exchange server version, a MAPI client (Outlook in this case) will set the  PR_LOCALE_ID property in the user’s information store to the ID of the locale (LCID) in which the MAPI client (Outlook) is running during logon. That may or may not work for you.

I do not know exactly how the value used for the LCID is determined by Outlook, so this may not be useful in environments that have a complicated Office language configuration.

Also, the way in how the PR_LOCALE_ID property is set varies greatly depending on your Exchange version. I believe that in Exchange 2007+ it will only set the LCID during profile creation and initial logon, and won’t touch it again, even if the user’s locale changes. Creating a new profile is the only way for it to update.

I have not written anything that provides the functionality described above, so your mileage may vary with that technique.

You do have another option available to you if you have access to the registry, however. If you have Outlook 2007 installed, you should have a registry key named “InstalledUI” located at (assuming 32-bit machine):

HKLM\SOFTWARE\Microsoft\Office\12.0\Common\LanguageResources\InstalledUI If you look in that key, you should see values that have an LCID for the name. You can conclude that any LCID appearing here is supported by the system. The values for each LCID (REG_SZ) indicate the status of the language. So, for example, I’ll have a value named “1033″ set to “On” if English is active for me.

Hopefully, one of these techniques will prove useful for you.will prove useful for you.

My response does leave some questions open however. Any comments or thoughts on this subject would be appreciated.

Matt Weber

I'm the founder of Bad Echo LLC, which offers consulting services to clients who need an expert in C#, WPF, Outlook, and other advanced .NET related areas. I enjoy well-designed code, independent thought, and the application of rationality in general. You can reach me at matt@badecho.com.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
   
© 2012-2013 Matt Weber. All Rights Reserved. Terms of Use.