Click here to Skip to main content
13,351,050 members (55,298 online)
Click here to Skip to main content
Add your own
alternative version


31 bookmarked
Posted 1 Aug 2003

SmartReplace AddIn [VC 6.0]

Rate this:
Please Sign up or sign in to vote.
Yet another replace dialog


There already are some nice substitutions for the built-in replace dialog available, but none of them entirely satisfied my needs. This is why I've written yet another one.

This AddIn, in contrast to all others I know of, does the actual find and replace operation inside the DevStudio IDE, meaning that each file that gets scanned for replacements is acutally opened as a document. This way you can replace within serveral files and watch the result prior to saving them.


Simply put the binary into your %MSDevDir%\AddIns folder and enable it in the Tools | Customize | AddIns & Macros dialog.


The AddIn installs a toolbar icon. Simply click it or add a keyboard shortcut to its command to your profile.

New case option

Here is a brief description of the new option

All Cases

When enabled, the replace command replaces all three cases, i.e. as-is, lower-case and upper-case, of the find string with the same case of the replace string. For instance, if the find string is "Abc" and the replace string is "Def" then "abc" will be replaced with "def", "Abc" will be replaced with "Def" and "ABC" will be replaced with "DEF" while all other cases, e.g. "aBc", remain unchanged.

New replace locations

The new replace locations are enabled by selecting "Extended" in the "Replace where" group. Press the "Advanced" button to show the extended locations options. Here is a brief description of the new replace locations:

All open text files

Replaces all instances of the find string with the replace string in all open text documents.

All text files within current project

Replaces all instances of the find string with the replace string in all text documents belonging to the active project of the workspace.

All text files within current workspace

Replaces all instances of the find string with the replace string in all text documents belonging to either project of the workspace.

All text files in specified directory

Replaces all instances of the find string with the replace string in all files matching the filter provided by the "File Extensions" and "Directory" combo boxes. Check the "Recurse" option to extend the operatio to all sub directories.

All text files matching file and folder filters

Replaces all instances of the find string with the replace string in all files matching the filters provided by the "Filters..." dialog.

Global options

Press the "Options..." button to open the global options dialog

SmartReplace Options


Here you can specifiy when to ask your permission for replacement. Available options are: Never, Each Instance, Each File and Each Project. The "Only ask in extended mode" disables the confirmation dialog for the "oridnary" replace locations "Selection" and "Current File".


Lets you specify when to save and close documents that got modifed during the replace operation. Available modes are: Always, Never and Ask.

File and Folder Filter

Lets you specify the folders and file filters to use with replace location "All files matching file and folder filters".

SmartReplace Filters

Known Bugs

See the ReadMe.txt for Known Bugs and ToDo list.


The AddIn incorporates a yet unfinished light-weight DevStudio Automation Model Interface wrapper library that aims at speeding up AddIn Development. Perhaps you might find it useful for your own AddIn projects.


SmartReplace 1.2

New Features

  • Added regular expression context menus (thanks to Daniel Beutler [chefsponk] for the code)
  • Moved DSWrapLib to a seperate project
  • SmartReplace 1.1

    New Features

  • Enabled "Regular Expression"
  • Added Browse For Folder Button
  • Browse For Folder dialogs now open at current directory
  • "File Extensions" can now be entered manually
  • "File Mask" now supports multiple filters (i.e. "*.cpp;*.h")
  • Bug Fixes

  • "Cancel"-hang fixed
  • "Continue" and "Replace" now stop atfer all instances have been enumerated
  • "Match Whole Words" now works in all modes execpt "Selection"
  • "Regular Expression" now works in all modes execpt "Selection"
  • License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here


    About the Author

    Roman Keskenti [SmoCoder]
    Web Developer
    Germany Germany
    No Biography provided

    You may also be interested in...

    Comments and Discussions

    GeneralProblems Pin
    RocketFuMaster17-Sep-03 5:54
    memberRocketFuMaster17-Sep-03 5:54 
    GeneralRe: Problems Pin
    Roman Keskenti [SmoCoder]17-Sep-03 8:00
    memberRoman Keskenti [SmoCoder]17-Sep-03 8:00 
    Thanks for your reply. I confess I already knew about these problems when I submitted the last version. I'm sorry for the inconvenience but at present I'm very busy and do not have enough spare time to fix these bugs. I'll try to fix and repost it as soon as possible. In the mean time: would perhaps some reader like to give it a try ...?
    GeneralConfiguration Control Integration Pin
    ayreon5-Aug-03 22:30
    memberayreon5-Aug-03 22:30 
    GeneralRe: Configuration Control Integration Pin
    Roman Keskenti [SmoCoder]6-Aug-03 2:21
    memberRoman Keskenti [SmoCoder]6-Aug-03 2:21 
    GeneralI like the design... Pin
    Paul Selormey2-Aug-03 17:58
    memberPaul Selormey2-Aug-03 17:58 
    GeneralFeatures Pin
    okigan2-Aug-03 11:20
    memberokigan2-Aug-03 11:20 
    GeneralRe: Features Pin
    Roman Keskenti [SmoCoder]2-Aug-03 12:36
    memberRoman Keskenti [SmoCoder]2-Aug-03 12:36 
    GeneralRe: Features Pin
    okigan23-Jan-04 1:07
    memberokigan23-Jan-04 1:07 
    GeneralRe: Features Pin
    okigan23-Jan-04 1:27
    memberokigan23-Jan-04 1:27 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web01 | 2.8.180111.1 | Last Updated 24 Aug 2003
    Article Copyright 2003 by Roman Keskenti [SmoCoder]
    Everything else Copyright © CodeProject, 1999-2018
    Layout: fixed | fluid