Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you export and import Visual Studio macros?

I would like to export some macros that I have defined and be able to import them into another clean install of Visual Studio with the same module/naming structure that I have defined.

I have some menu command customizations that execute my macros - so to work in another install of Visual Studio, it needs the same macros available.

I would like to avoid a manual step of having to create the macro manually and copy/paste my macro code.

Is this possible? It doesn't seem like 'macros' is an available option to import/export through menu Tools -> Import and Export Settings.

like image 791
Adam Avatar asked May 01 '09 21:05

Adam


People also ask

How do I run a saved import from a macro?

On the External Data tab, click either Saved Imports or Saved Exports. In the Manage Data Tasks dialog box, on the Saved Imports or Saved Exports tab (depending on your choice in the preceding step), click the specification that you want to run. Click Run.

How do I create a macro in Visual Studio?

On the Tools tab, select Visual Basic to open the Visual Basic Editor. In the Visual Basic Project Explorer, right click on the project folder, and choose Insert > Module. In the code window, add a subroutine by entering Sub followed by the name for the macro.


1 Answers

Tools->Macros->Macros IDE... (or Alt+F11)

Export: Expand your macros until you find the module you want to export, right-click it, choose Export ModuleName..., select a file, and Save.

Import: Select "MyMacros" or any other, right-click it, and choose Add->Add Existing Item... Select the file you just created, and Add.

like image 94
Chris Doggett Avatar answered Sep 29 '22 21:09

Chris Doggett