Using Quick Find
Keyboard: CTRK + F
Menu: Edit -> Find and Replace -> Quick Find
Command: Edit.Find
Versions: 2008,2010
Published: 6/14/2010
Code: vstipFind0007
There's more to Quick Find than meets the eye. Let's take a look at all the great stuff that is in there! Press CTRL + F to bring up the Quick Find tool window:
Okay, so notice this is a tool window so right away it can be docked like any other tool window pretty much anywhere you want. Notice the Quick Find drop down let's you choose what type of find you want to do:
For this discussion we will only focus on the Quick Find choice but each of these items comes with its own set of options. The "Find what" area is used to determine what you want to find:
You can type what to look for in the dropdown combo box or you can choose from the list of previous searches:
Don't worry about that extra button to the right of the dropdown combo box-we will get to that later :)
Next is the "Look in" area. It's used to determine the scope of your search:
Most of the options are pretty self explanatory. There are a couple of key things to know: First, "Current Project" and "Entire Solution" will search files whether they are open or closed. Second, "Current Block" is a little misleading as it doesn't search the current block but the entire function/sub you are currently in.
The "Find options" area is where the fun really happens:
Here is a run-down of these options:
Match case - Makes your search case-specific. Searching for elocal would show "elocal" but not "eLocal" or any other variant.
Match whole word - by default the search is a "contains" operation and will find anywhere the word exists. For example, searching for "elocal" will find "elocal" and "elocalstuff", etc.
Search up - Ordinarily, the search will start from the current cursor location and search down in the current document. You can use this option to search up from the current cursor location instead.
Use -
This is a LOT more interesting and requires a bit of explanation. When you select this you get to choose between "Regular expressions" and "Wildcards":
When you use this option it will automatically enable the Expression Builder button to the right of the "Find what" combo box:
Regular Expressions - Let's you use regular expressions in your search. If you are not familiar with regular expressions you can check out my series on them here: https://blogs.msdn.com/b/zainnab/archive/2008/03/11/regular-expression-webcast-series.aspx. Here is what the Expression Builder button will give you when you use it:
Wildcards - This isn't as advanced as regular expressions but is more familiar to most people. It allows you to use special characters to represent one or more letters. Go here for more information on wildcard searches: https://msdn.microsoft.com/en-us/library/afy96z92.aspx. This is what the Expression Builder button will give you with this item selected:
Finally, we have the two buttons at the bottom of the Quick Find tool window:
Find Next - Will keep going to the next instance of the search term you are looking for until it reaches your original starting point.
Bookmark All - will automatically place a bookmark at every location where the search term is found. Use this with caution as it can definitely cause a large number of bookmarks to be created. Here is a simple example when I looked for the word "start" in the current block:
There you go! Everything you need to know about using Quick Find.
Comments
Anonymous
June 14, 2010
Hey Zain, Great series you've got going here! Maybe you should mention that the Regular Expression option with Find does NOT use the normal (.NET) regex rules and so on. Regular expressions have a whole life of its own inside Find :-) Keep up the good work! Best regards, JannikAnonymous
August 01, 2010
Great point Jannik! :)