If you require Office 2007/2003 support (which I assume is the reason you have the command bar's) then you ideally need to check the MajorVersion of the office interop dll that is running.
Then you can do soemthing like:
string majorVersionString = Globals.ThisAddIn.Application.Version.Split(new char[] { '.' })[0];
int majorVersion = Convert.ToInt32(majorVersionString);
if (majorVersion < 14)
{
//Register CommandBar
}
Then also create a ribbon targeting the OutlookExplorer ribbon. Because only office 2010 will request that ribbon type, then it will only work for Office 2010.
See http://msdn.microsoft.com/en-us/library/bb398246.aspx for how to create ribbon xml ribbons. The ribbon ID you are after is Microsoft.Outlook.Explorer
. More information about extending the Outlook explorer ribbon can be found at http://msdn.microsoft.com/en-us/library/ee692172.aspx#OfficeOLExtendingUI_Explorer
EDIT:
More information about multitargeting multiple versions of Office is available at http://blogs.msdn.com/b/vsto/archive/2010/06/04/creating-an-add-in-for-office-2007-and-office-2010-that-quot-lights-up-quot-on-office-2010-mclean-schofield.aspx