Finding Documents Containing Multiple Occurrences of a Word

by Allen Wyatt
(last updated January 3, 2015)

8

Brian has a lot of Word documents. When displaying the Open dialog box or when using a regular folder window, he can search and display only documents that contain a specific word. He wonders, though, if there is a way to display only documents that contain at least two occurrences (or more) of a particular word. In other words, he wants to exclude the display of documents that either don't contain the word or that have only a single occurrence of the word.

This is actually quite easy to do—just use a wildcard character when setting up your search. For instance, let's say that you want to search for documents that contain at least two instances of the word "widget." You could use this as your search criteria:

widget*widget

Note that the asterisk is a wildcard; it matches any number of characters. Thus, you end up searching for "widget" followed by any number of characters and then another instance of "widget." If the document contains only a single occurrence of the word "widget," then this search string automatically excludes those documents.

In order for this approach to work, you'll need to make sure that the "Always search file names and contents" option is selected in the Search tab of Folder Options.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9957) applies to Microsoft Word 2007, 2010, and 2013.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Previewing Your Web Page

Need to see what your document would look like as a Web page? Word allows you to get a glimpse by using the Web Page Preview ...

Discover More

Changing the Highlighting Color

You can highlight words and phrases in your document, much the same as you can mark printed words and phrases with a ...

Discover More

Starting in Safe Mode

By using a command-line switch, Excel can be started in safe mode. This means that the program is loaded with bare-bones ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Saving All Open Documents

Got a lot of open documents you are working with? You can save them all at one time by adding a handy tool to your Quick ...

Discover More

Saving Everything

Need to force users to save their work? It may be as simple as implementing a couple of macros that get a bit more aggressive ...

Discover More

Mirroring Documents

Have you ever wanted to have a Word document be accessible through two different folders? Here are several ways you can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 5?

2015-03-10 06:18:12

Ken Endacott

In Windows Explorer click the Tools menu item and in the dropdown list click Folder options. Click the Search tab and under What to search select Always search file names and contents.


2015-03-08 12:50:12

Jill

Feeling stupid -but how do I check 'Always search file names and contents'?


2015-01-09 06:16:44

Ken Endacott

In testing I have found a strange thing with Word 2003 documents. If the document contains widget then searching for widget will find the document. If all occurrences of the word widget are then deleted and the file saved then searching for widget will still find the file. It is as if the word widget is still in the file but is not visible.

This also applies with .doc files that are saved as .docx but does not apply with files created as .docx.


2015-01-08 10:31:12

Brian

This isn't working for me. Search is still displaying documents that have only 1 instance of the word, even though I have searched for widget*widget. The documents are in Word 2003 format (.doc) and I am using Word 2010 and Windows 7.


2015-01-05 15:40:51

Peter Wezel

Hi Ken, Ric,
thanks a lot for your advice. Indeed that does the trick and gives me the output that I was looking for. The usual Windows search returns a list of all files that contain either of the terms. Now I am able to retrieve only those files that contain both terms.
I am already thinking about new ways to use this trick. :)


2015-01-05 10:50:56

Ric Glines

The search utility Agent Ransack offers several features that are an improvement on the inadequacies of Windows Explorer's search utility.

The vendor offers both free and pro versions, and you can set it up so that you can access the utility from the context menu that appears when you right click in any folder in Windows.

It offers several search modes, from a guided wizard for novices, to full support of regular expressions for more advanced users. I've been using the free version for many years.

Here's the vendor's site for this utility: http://www.mythicsoft.com/agentransack/


2015-01-05 01:23:12

Ken Endacott

Peter,
In Windows Explorer, select the folder that you want to search (or select C: for the whole drive). At the top right hand of Windows Explorer you will see an input box containing Search foldername. Enter your search text which will be something like 'Invoice*Acme Company' (without the quote marks). A list of files containing the search criteria in the name of the file or in the body of document will be given.

Important: make sure that 'Always search file names and contents' is checked in Tools/Folder options/Search otherwise only the file names will be searched.


2015-01-03 09:29:47

Peter

This sounds like something I always wanted to have, but was afraid to ask for. I would like to use this feature to search for documents containing a combination of two words, e.g. "Invoice" in combination with a vendor name. Unfortunately, I cannot figure out where I should enter the search term. There is the regular Search box at the bottom of the Start menu in Windows, but this does not accept the wild card (the * is treated like a space). Please advise.


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.