WinForms FAQ - Macros

Can VB.NET code be formatted using macros

VB.NET can perform decent autoformatting for code that may not be properly formatted. Here is a macro that can call this Auto Formatting command for all the files in a project.

Grab utils.zip.

Permalink
Is it possible to call macros as part of a Visual Studio.NET command line build (or from a batch file)

Yes. You just use the following syntax:

devenv.exe {Solution Name} /command {Macro name}

Example:

devenv.exe 'myproject.sln' /command 'Macros.Syncfusion.Utils.FormatProjectAndClose'

Dev studio will start up, load the solution, run the macro and then terminate.

Be sure to check that devenv.exe is available from your command line. Normally, you just have to run VSVARS32.bat to ensure this if you do not already have this in your path.

Permalink