
Private Sub recurseSolution(ByVal taskRoutine As task)įor Each Proj As Project In įor Each Item As ProjectItem In Proj.ProjectItems Private Delegate Sub task(ByVal Item As ProjectItem)

Private Sub formatItem(ByVal Item As ProjectItem)ĭebug.Print("processing file " + Item.Name)ĭTE.ExecuteCommand("Edit.FormatDocument", "")ĭebug.Print("error processing file." + ex.ToString())Įrrors.Append("error processing file " + Item.Name + " " + ex.ToString()) If Not skippedExtensions.Contains(ext) Then 'Debug.Print("ignoring file with extension: " + ext) ignoring.")Įxt = ((".")) 'get file extension Private Sub processItem(ByVal Item As ProjectItem) Note that this is older than the version available on github above.ĭim allowed As List(Of String) = New List(Of String)ĭim errors As StringBuilder = New StringBuilder()ĭim skippedExtensions As List(Of String) = New List(Of String)ĭebug.Print("error in main loop: " + ex.ToString())ĭebug.Print("processed items: " + processed.ToString())ĭebug.Print("ignored items: " + ignored.ToString())ĭebug.Print("ignored extensions: " + String.Join(" ", skippedExtensions.ToArray()))

You have to keep an eye on it as it's interactive and does sometimes pop up a message and wait for an answer.īelow is the original code. It runs "edit, format document" on every document of the listed file types. Here's a handy macro script for visual studio I knocked together today.
