Published: Sunday, 07 May 2006 19:26
Recently, I was asked an interesting question. How to get search results of Find In Files operation in VS? You can get these results quite easily from your macro or add-in. The trick is to read the contents of Find Results 1 or Find Results 2 window, whichever was used to show the results. So, the first thing is to determine which of them was used. We do it right after manually performed search from menu or our call of
DTE.Find.ResultsLocation property will tell us this. Then we find the window and get its content.
The whole code which gets results of the last Find In Files operation is: