Referred from: Locate File in Solution Explorer – Visual Studio Macro
Toogle “Track Active Items” (Tools –> Options –> Projects and Solutions).
This feature, when enabled, syncs the selected item in your solution explorer to the file being viewed.The below Macro will assist you finding the current file while leaving the feature turned off.
Go to Tool-Options-Environment-Keyboard and bind it to a shortcut key and you are all set – mine is bound to (ALT+L, ALT+L) or (Ctrl-`). To see your macro, type its name in the search box.
Public Sub LocateFileInSolutionExplorer()
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
DTE.ExecuteCommand("View.SolutionExplorer")
End Sub
To add a macro (in Visual Studio 2008), browse to Tool – Macro – Macro Explorer, then select/create a module and open it, then paste the script above and save. That’s it.
Enjoy!
10.759180
106.662498
Read Full Post »