Automating VS2010 for addins

Nov 10, 2011 at 5:13 PM


I am trying to automate VS2010 menus and submenus as we are creating an Addin for VS2010

I am able to access the menus, but unable to access the submenus.

can anyone please help me.

I am using Win 6 64 bit O.s and compiling VS2010 in Any CPU mode

My code is as follows

window1 = application.GetWindow("Start Page - Microsoft Visual Studio (Administrator)", InitializeOption.NoCache.AndIdentifiedBy("devenv"));


 Menu MainMenu12 = window1.Get<Menu>(SearchCriteria.ByText("File"));


//This works for Main Menu.

//For submenus I tried the following. It does't work

  MenuBar menubar1 = window1.MenuBar;

Menu menunew = menubar1.MenuItem("Exit");

menunew.Click(); // This does not work as menubar1 returns just one menu i.e New Project. How to view the other menus is the question.

I tried increasing the busytimeout value in app.config . this did not solve the problem