Regarding toolbar
-
I tried the following code below which is given in msdn. But i am not getting any button on the toolbar. Can anyone tell why. applicationObject = CType(application, EnvDTE.DTE) addInInstance = CType(addInInst, EnvDTE.AddIn) If connectMode = Extensibility.ext_ConnectMode.ext_cm_UISetup Then Dim objAddIn As AddIn = CType(addInInst, AddIn) Dim CommandObj As Command ' When run, the Add-in wizard prepared the registry for the Add-in. ' At a later time, the Add-in or its commands may become unavailable for reasons such as: ' 1) You moved this project to a computer other than which is was originally created on. ' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in. ' 3) You add new commands or modify commands already defined. ' You will need to re-register the Add-in by building the MyAddin1Setup project, ' right-clicking the project in the Solution Explorer, and then choosing install. ' Alternatively, you could execute the ReCreateCommands.reg file the Add-in Wizard generated in ' the project directory, or run 'devenv /setup' from a command prompt. Try Dim cmds As Commands Dim cmdobj As Command Dim customin, customout As Object Dim cmdbarobj As CommandBar Dim colAddins As AddIns ' Set references. Dim DTE As EnvDTE.DTEClass colAddins = DTE.AddIns() cmds = DTE.Commands cmdobj = cmds.Item("File.NewFile") ' Create a toolbar and add the File.NewFile command to it. cmdbarobj = cmds.AddCommandBar("Mycmdbar", vsCommandBarType.vsCommandBarTypeToolbar) MsgBox("Commandbar name: " & cmdbarobj.Name) cmdobj = cmds.AddNamedCommand(colAddins.Item(1), "mycommand", "mycommand", "tooltip for mycommand", True)