By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,658 Members | 1,501 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,658 IT Pros & Developers. It's quick & easy.

Find and Replace utility thru DTE.find

P: n/a
I want to find out that if there is a mechanism to find a text inside a C# file and replace it with another string.

I am using DTE to do it, the find proerty does it, the results are getting displayed in a find results window pane , but I m not able to programmatically take the contents of the pane.

DTE.Find.FindWhat = "catch"
DTE.Find.Target = vsFindTarget.vsFindTargetFiles
DTE.Find.MatchCase = False
DTE.Find.MatchWholeWord = False
DTE.Find.MatchInHiddenText = True
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
DTE.Find.SearchPath = "Current Project"
DTE.Find.SearchSubfolders = True
DTE.Find.FilesOfType = "*.aspx.cs"
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResults1
DTE.Find.Action = vsFindAction.vsFindActionFindAll
DTE.Find.Execute()
DTE.Windows.Item(Constants.vsWindowKindFindResults 1).Activate()
MsgBox(DTE.ActiveWindow.Caption)

I am able to access the caption of that result pane but not the contents of that result pane.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.