Reputation: 2130
Our development group is using Visual Studio 2010.
I have created a library of various macros that our development group uses. The library is a typical XXX.vsmacros module. The module has code (a macro) that also creates a menu item in the manu bar, allowing developers easy access to various commands. The problem is, I would like to not have to manually run the code to create the menu item each time Visual Studio is started up.
I can see two possible solutions to this.
(1) If a user manually creates the top-level menu via the typical "Customize" dialog, then the menu item (a commandBarPopup item) is flagged as "BuiltIn", and so it persists between invocations of Visual Studio. However, I can find no way to create an equivalent menu programmatically - any attempts to create the menu always results in the "BuiltIn" property ( a read-only property) being set to "false", and then the menu disappears. Does any one know how to programmatically create a permanent menu?
(2) If I cannot programmatically create a permanent menu, then I would like to re-create the menu each time the macros module is loaded (this is the best approach). Most of MicroSofts VB suites provide for SOME method of automatic execution of macro code on loading. I cannot find such a thing for the loading of Visual Studio modules. Does anyone know if visual Studio modules have an "_onload" or "_autoexec" or "_autosomething" macro facility for executing code when the module is first loaded?
Thanks.
Upvotes: 1
Views: 132