locked
VS2010: How to find in project, programmatically RRS feed

  • Question

  • How do I programmatically perform a find all in project? Ive looked at ITextSearchService but that seems to require me to load each of the files I want to search. Ive also looked at EnvDTE.Find and that doesnt seem to return the results in such a way that I can use them programmatically.
    Wednesday, September 1, 2010 10:52 PM

Answers

All replies

  • Hi JGreene,

    If you want to get “Find in Files” Search Results programmatically, you can find the Results Location Window and get its content. For more information, please see: Getting “Find in Files” Search Results programmatically . But it only works fine in Visual Studio 2008, we can’t do it in Visual Studio 2010.

    So I would suggest you use ITextSearchService to do it. You can enumerate all the project files, and then load each of the files you want to search. Please refer to How to enumerate all the project files in a IVsProject? for more information.

    EDIT: Share you a great sample Visual Studio Find Results Window Tweak, maybe it is what you want.

    If I misunderstood you, or you have any comments, please feel free to let me know.

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by JGreene Tuesday, September 7, 2010 9:09 PM
    Thursday, September 2, 2010 8:10 AM
  • Hi,

    I am writing to follow up this issue. Please let me know what I can help. Thanks.

     

    Regards,

    Nancy Shao [MSFT]
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, September 7, 2010 6:46 AM
  • I suppose you answered my question, it just wasn't the answer I was hoping for.
    Tuesday, September 7, 2010 9:09 PM