Loading ...
Sorry, an error occurred while loading the content.
 

Re: Adding comamnds to VS2005's main menus

Expand Messages
  • Duncan Lees
    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
    Message 1 of 3 , Jun 1, 2006
      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

      Tar,
      -Duncan

      > 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
      > 2005:
      >
      > Dim colCommandBars As CommandBars
      > Dim objCommandBar As CommandBar
      > Dim objCommandBarControl As CommandBarControl
      > Dim objCommandBarControl2 As CommandBarControl
      > Dim objCommandBarPopup As CommandBarPopup
      >
      > colCommandBars = DirectCast(applicationObject.CommandBars,
      > CommandBars)
      > objCommandBar = colCommandBars.Item("MenuBar")
      >
      > objCommandBarControl = objCommandBar.Controls.Item("Project")
      > objCommandBarPopup = DirectCast(objCommandBarControl,
      > CommandBarPopup) ' This works fine
      > objCommandBarControl2 =
      > objCommandBarPopup.Controls.Add(MsoControlType.msoControlButton)
      > 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:
      > http://www.mztools.com
    Your message has been successfully submitted and would be delivered to recipients shortly.