4

I would like Visual Studio to format my source code every time I save. I can do this in Eclipse. Can it be done in Visual Studio 2005?

2 Answers 2

5

It is possible with the Powercommands plugin for VS.NET, but, I fear that this plugin is only available for VS.NET 2008.

Sign up to request clarification or add additional context in comments.

Comments

4

You can do it with a macro.

Here is the code for the macro, which can be mapped to a button in a toolbar and/or a keyboard shortcut

Public Module SaveAndFormat
    Sub SaveAndFormat()
        DTE.ExecuteCommand("Edit.FormatDocument")
        DTE.ActiveDocument.Save()
    End Sub
End Module

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.