I used macros often before Visual Studio 2012. Although it was awkward to write it in VBScript, it did the tricks. For example if you wanted to join two lines in visual studio, you could create the macro and assign a keyboard shortcut (I usually assigned ALT+J). Here is the Macros I used to join two lines. It worked like a charm.
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports EnvDTE90a
Imports EnvDTE100
Imports System.Diagnostics
Public Module TonyJiang
Sub JoinLines()
DTE.ActiveDocument.Selection.EndOfLine()
DTE.ExecuteCommand("Edit.Delete")
DTE.ActiveDocument.Selection.Insert(" ")
DTE.ActiveDocument.Selection.EndOfLine()
End Sub
End Module
Now macros are gone in Visual Studio 2012, which triggered me to bing if there were any options to do the tricks for me. It turned out that a pleasant surprise was waiting for me. I found www.codemaid.net, which owned the functionality of join two lines and much way way much more by pressing CTRL+M, J. But what really excited me was there were so much more functionalities to clean the code, such as sorting the using clause and adding endregion name etc. It was so cool that I would encourage for every .NET developer to install it. Solute to the developers of codemaid!
Code Cleaning
Cleanup random white space into a simple standard order. Add unspecified access modifiers. Utilize Visual Studio's built-in formatting capabilities. Remove and sort using statements. And do it all automatically on save or on demand, from an individual file to the entire solution.