views:

318

answers:

1

I have recently noticed how interesting Visual Studio's macros are. I did not use VB for ages so it took me a while until i finally managed to write a little macro that performs some stuff on the currently open document.

Enthusiastically, I next wanted to use this macro on every source code file (.cs) in the solution without having to manually open all files. Could you give me a quick hint on how to do this?

+2  A: 

Check out the DTE object reference. Inside a macro you can reference some really neat global properties, like DTE.Solution, which returns a Solution object that describes the currently open solution (and, not surprisingly, has a Projects property, which is a collection of all Projects in the solution). You should be able to iterate over pretty much anything you want at that point!

Have fun :)

Mike
Thanks, missed this. Easier than i thought. :)
mafutrct