If you are developing addins for Visual Studio, you should be aware that there are several localized editions (Spanish, German, French, etc.). This article provides info to take into account when locating commandbars by name in your add-in:
HOWTO: Locate commandbars in international versions of Visual Studio
http://www.mztools.com/articles/2007/MZ002.htm
Hi Carlos,
Thanks for your great article.
I have the same need for a CommandBarButton, which is not of CommandBarPopup type, i.e. I could first find the “File” menu using your cast, but then I can not find a localized menu item such as “New Project”.
Any idea?
Rgds
See:
You can iterate the CommandBarControls of the CommandBar, and for those which are a CommandBarButton (and not a CommandBarPopup) retrieve the command behind then using:
HOWTO: Retrieve the Command that created a CommandBarControl from a Visual Studio add-in or macro
http://www.mztools.com/articles/2008/MZ2008021.aspx
Once you have the command you can check the Command.Name, which is always in English, not localized (such as “File.NewProject” in your case)