I am developing an outlook 2007 add in.
How can i know the outlook language(English or French versi开发者_运维技巧on..)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.
精彩评论