Re: Adding comamnds to VS2005's main menus
- Thanks for verifying that it was possible Carlos.
After looking at the project created by the Addin wizard (why didn't I
think of doing this before?), I was able to find the type library
holding the VisualStudio CommandBars definitions. Then I just needed to
specify the new VS IID for CommandBarPopup in the QI, instead of having
to change my code to use all the new VS interfaces. If anyone ever needs
it, it's: AAD0C7E1-12EB-4271-9538-2C91B460012B
> Date: Wed May 31, 2006 3:55 am (PDT)
> From: "Carlos J. Quintero" carlosq@...
> Subject: Re: Adding comamnds to VS2005's main menus
> Hi Duncan,
> It should work if you are using the new Microsoft.VisualStudio.CommandBars
> instead of the old Office.Core reference. This code works fine with VB.NET
> Dim colCommandBars As CommandBars
> Dim objCommandBar As CommandBar
> Dim objCommandBarControl As CommandBarControl
> Dim objCommandBarControl2 As CommandBarControl
> Dim objCommandBarPopup As CommandBarPopup
> colCommandBars = DirectCast(applicationObject.CommandBars,
> objCommandBar = colCommandBars.Item("MenuBar")
> objCommandBarControl = objCommandBar.Controls.Item("Project")
> objCommandBarPopup = DirectCast(objCommandBarControl,
> CommandBarPopup) ' This works fine
> objCommandBarControl2 =
> objCommandBarControl2.Caption = "Hello"
> objCommandBarControl2.Visible = True
> Best regards,
> Carlos J. Quintero
> MZ-Tools: Productivity add-ins for Visual Studio.
> You can code, design, locate code and document your apps much faster: