473,406 Members | 2,356 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,406 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 1731
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.