Visual studio Reformat Code/Document

You can use Edit > Advanced > Format Document and you can also move this as a button to any toolbar. Go to Tools > Customize > Commands, select Toolbar and push Add Command button. Then select Edit category and find Document Format.


Apparently VS2010 (maybe others) hide certain commands depending on the style you choose. I chose Web Dev (code) as my choice and the Document Format is not present to be added to a toolbar. But, if I change to C# Code (tools>Import/Export) then the Document Format command is right there in the Edit menu where others here have said it is.

I had to import the C# Dev layout, but unchecked colors and code formatting options (so it won't overwrite those). What section you must import to get the format document button, I don't know, I didn't experiment that deep.

Seems stupid MS chose to force us down specific paths for layout with no convenient way to get out of it.