473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Invoking the Replace Dialog from code

Dan
Anyone know how to invoke the .NET Replace dialog thorugh code (say, from
within an addin)? More specifically, I'm trying to open the replace dialog
with some pre-set parameters (such as FindText and ReplaceWith) for the
user. I've tried executing Edit.Replace with just about every option but it
either displays without any options or remains hidden.

TIA
Jul 21 '05 #1
1 1729
Hi Dan,

Do you mean something like this for example (from a macro, but you should be
able to do similar from an addin I guess):
Sub Test()
DTE.ExecuteCommand("Edit.Replace")
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
DTE.Find.FindWhat = "\}[\n ]*else[\n ]*\{"
DTE.Find.ReplaceWith = "\}else\{"
DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase = False
DTE.Find.MatchWholeWord = False
DTE.Find.MatchInHiddenText = False
DTE.Find.PatternSyntax =
vsFindPatternSyntax.vsFindPatternSyntaxRegExpr
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
REM DTE.Find.Execute()
REM DTE.Windows.Item(Constants.vsWindowKindFindReplace ).Close()
End Sub

Cheers
Doug Forster

"Dan" <dp**********@hotmail.com> wrote in message
news:vn************@corp.supernews.com...
Anyone know how to invoke the .NET Replace dialog thorugh code (say, from
within an addin)? More specifically, I'm trying to open the replace dialog
with some pre-set parameters (such as FindText and ReplaceWith) for the
user. I've tried executing Edit.Replace with just about every option but it either displays without any options or remains hidden.

TIA

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bbxrider | last post by:
running win2k adv server/ iis5.0 trying to setup on my web page where browsers can download a file, an .xls so been trying to figure out with a download 'link' what invokes the standard ms file...
3
by: Dave | last post by:
I have an Access 2K application that is distributed to about a dozen users (all with identical NT environments and identical Access versions, object libraries and service packs). I am using the VBA...
1
by: Dan | last post by:
Anyone know how to invoke the .NET Replace dialog thorugh code (say, from within an addin)? More specifically, I'm trying to open the replace dialog with some pre-set parameters (such as FindText...
5
by: Jan Bares | last post by:
Hi, I have .NET 2003. When I run "Find in Files" command, everything works as expected. However when I run "Replace in Files" with the same settings a and press Find Next, I get: "Look in: A...
0
by: Dan | last post by:
Anyone know how to invoke the .NET Replace dialog thorugh code (say, from within an addin)? More specifically, I'm trying to open the replace dialog with some pre-set parameters (such as FindText...
0
by: ApexData | last post by:
I Want Access FIND&REPLACE to stay in FIND mode. Can I place the (Access FIND&REPLACE Dialog) in a popup/modal dialog form? I need to control this process to prevent the user from pressing keys...
8
by: Captain Dondo | last post by:
I have an array(?) (sorry, I'm new* to python so I'm probably mangling the terminology) that looks like this: I want to replace every instance of 'tooth.seiner.lan' with 'localhost'. There...
1
by: =?Utf-8?B?VGVlcmF2ZWU=?= | last post by:
I try to invoke Connection Properties dialog box that Visual Studio 2005 use. The dialog that I said is used in many places such as when developers build connection string in Settings.setting file...
5
by: eddiefisher41 | last post by:
Hey Guys. This is kind of a mixed question involving the os platform, python and wxpython. I hope this is in the right place, if not then a quick link to somewhere suitable would be great. Ok...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.