views:

26

answers:

1

When running an external tool in VS 2008, open modified fiels aren't save anymore before the tool executes. That's a PITA change from VC6, and has caused us a lot of trouble already.

Is there any way to get this functionality back?

+1  A: 

A simple approach for this sort of problem is to use a macro (2 lines of code would probably suffice). Once built the macro can be easily executed from the macro explorer or assigned to a hotkey.

e.g.

File.SaveAll()
DTE.ExecuteCommand ("Tools.ExternalCommand7")

(Tip: You can find out what the command you need to execute is by recording a temporary macro (often ctrl+shift+R), executing your tool, stopping recording (ctrl+shift+R again) and then going to Tools->Macros->Macros IDE and opening up the temporary macro's code).

(If you don't know how to use VS macros and the temporary macro, then I suggest you learn a bit about them - they are absolutely awesome time savers once you get to know how to use them).

Jason Williams
It's a what I'd call "I know I could do that but but I could also poke a toothbrush in my eye" solution, but apparently the best I get. Thanks for the clear and helpful how-to.
peterchen