How do I get the CurrentUICulture in my Office AddIn to match Windows?

J

\Ji Zhou [MSFT]\

Hello Dave,

As you already find, changing the Location and Language Format in the
control panel will only change the CurrentCulture of CultureInfo class. To
change the default CurrentUICulture, we need to install the corresponding
language MUI firstly. And then, in the Windows XP, we can follow this link
to set the default UI language for a user. See the section of Windows XP:
How to change the Default User UI Language,
http://www.microsoft.com/globaldev/reference/win2k/setup/changeUI.mspx

For a detailed discussion about the difference of the CurrentCulture and
the CurrentUICulture, please visit
http://blogs.msdn.com/ddietric/archive/2008/02/05/yacvcp-yet-another-current
culture-vs-currentuiculture-post.aspx

Have a nice day!


Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi;

Ok, I installed the Office 2007 MUI and set Word to use German. (I am
running on US Windows XP because we can't get the MUI for XP.) So Word
is runnign in German - but the CurrentUICulture is still set to
English.

Do I need to query something in Office when my AddIn starts to then
set the CurrentUICulture to match Office? Because if Windows and
Office disagree on the UI culture, I think the AddIn should match
Office.

thanks - dave


Hello Dave,

As you already find, changing the Location and Language Format in the
control panel will only change the CurrentCulture of CultureInfo class. To
change the default CurrentUICulture, we need to install the corresponding
language MUI firstly. And then, in the Windows XP, we can follow this link
to set the default UI language for a user. See the section of Windows XP:
How to change the Default User UI Language,
http://www.microsoft.com/globaldev/reference/win2k/setup/changeUI.mspx

For a detailed discussion about the difference of the CurrentCulture and
the CurrentUICulture, please visit
http://blogs.msdn.com/ddietric/archive/2008/02/05/yacvcp-yet-another-current
culture-vs-currentuiculture-post.aspx

Have a nice day!


Best regards,
Ji Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
T

Tony Jollans

In Word, Application.Language (or
Application.LanguageSettings.LanguageID(msoLanguageIDUI)) returns the Office
UI language.
 
D

David Thielen

Spoke too soon - for Excel & PPT it only has LanguageSettings and that
wants a MsoAppLanguageID - what do I pass for that ID as I think that
sets the language - and I need to get the language in use.

thanks - dave


In Word, Application.Language (or
Application.LanguageSettings.LanguageID(msoLanguageIDUI)) returns the Office
UI language.


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
C

Cindy M.

Hi David,
I used the Control Panel to change my copy of XP to be German instead
of English. When I run Office my Addin reports German for
CurrentCulture but remains English for CurrentUICulture.

I also changed Word to make the default German - still comes up
English.
Which version of Office is this, and what more exactly are you trying
to accomplish (why do you need the information)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
T

Tony Jollans

Caught out by that integrated suite again :-( That looks like a problem, one
to which I have no answer; sorry.
 
D

David Thielen

Hi;

Lets say a user is running on the English version of Windows but is
running Office in German. In that case I want my AddIn to be in German
- to match office. So I need to set the CurrentUICulture to match that
of Office.

thanks - dave


Hi David,

Which version of Office is this, and what more exactly are you trying
to accomplish (why do you need the information)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
C

Cindy M.

Hi David,
Lets say a user is running on the English version of Windows but is
running Office in German. In that case I want my AddIn to be in German
- to match office. So I need to set the CurrentUICulture to match that
of Office.
Right. My question crossed with your discussion with Ji and Tony. (Off-
line reader, and I forgot to hit "send" before closing down that day.)
Spoke too soon - for Excel & PPT it only has LanguageSettings and that
wants a MsoAppLanguageID - what do I pass for that ID as I think that
sets the language - and I need to get the language in use.
This appears to be what you need. It returns the msoLanguageID (such as
1033) the user is seeing.

Application.LanguageSettings.LanguageID
(Office.MsoAppLanguageId.msoLanguageIDUI)

Here's the entire Enum listing from the Office 2007 Help:

msoLanguageIDExeMode 4 Execution mode language.
msoLanguageIDHelp 3 Help language.
msoLanguageIDInstall 1 Install language.
msoLanguageIDUI 2 User interface language.
msoLanguageIDUIPrevious 5 User interface language used prior to the
current user interface language.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
D

David Thielen

Fantastic - thanks - dave

Hi David,

Right. My question crossed with your discussion with Ji and Tony. (Off-
line reader, and I forgot to hit "send" before closing down that day.)

This appears to be what you need. It returns the msoLanguageID (such as
1033) the user is seeing.

Application.LanguageSettings.LanguageID
(Office.MsoAppLanguageId.msoLanguageIDUI)

Here's the entire Enum listing from the Office 2007 Help:

msoLanguageIDExeMode 4 Execution mode language.
msoLanguageIDHelp 3 Help language.
msoLanguageIDInstall 1 Install language.
msoLanguageIDUI 2 User interface language.
msoLanguageIDUIPrevious 5 User interface language used prior to the
current user interface language.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top