Cindy Meister
Hi Chait
OK, here's your primary problem
private void CheckIfMenuBarExists()
{
try
{
Office.
CommandBarPopup foundMenu = (Office.CommandBarPopup) //etc.
I see that you're declaring all the objects for the commandbars at the procedural level. This means that they go out of scope as soon as the procedure ends and GC (garbage collection) has had a chance to clean them up.
You need to declare the objects at the class level. Then you can instantiate them in the procedure. Your code would look more like this:
Office.CommandBarPopup cmdBarControl = null;
Office.CommandBarPopup foundMenu = null;
private void CheckIfMenuBarExists()
{
try
{
foundMenu = (Office.CommandBarPopup) //etc.
As to the Ribbon... Right now all your controls are showing up in the Add-ins tab ("menu") in the 2007 app, correct This probably isn't optimal because all customizations (the user's, yours and any from a third-party) will be all mixed up under this tab. If you leverage RibbonX you can create your own tabs in Office 2007 applications. Here's a good place to start.