I have been trying to write a short macro in Visual Studio that activates the FindSymbolResults (Constants.vsWindowKindFindSymbolResults), and then moves to the next item in the list (if anyway) and calls Edit.GotoReference on it. The first and last parts - show the window and call Edit.GoToReference - are done, but I am struggling with moving to the next item in the window. Has anyone got an example of doing this or something similar they could share?
Asked
Active
Viewed 356 times
1 Answers
1
I know that in VS F8 usually navigates to the next result. With that in mind, I recorded a temporary macro to look and see what it might produce. With those results in hand, I wrote this quick little macro that will execute and open the first 10 results of a find symbol search.
Sub OpenAllFindSymbols()
DTE.ExecuteCommand("Edit.FindSymbol")
DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
For i = 1 To 10
DTE.ExecuteCommand("Edit.GoToNextLocation")
Next
End Sub
,All that to say I think the bit that you may be most interested in is
DTE.ExecuteCommand("Edit.GoToNextLocation")

Brian Schmitt
- 6,008
- 1
- 24
- 36