Finding "Whole Words Only" with Wildcards

If you often use wildcards with Microsoft Word's Find and Replace feature, you probably know that Word won't let you specify "Find whole words only" when the "Use wildcards" option is checked. This is more than an annoyance; sometimes you really *need* to be able to find whole words only while searching with wildcards.

To learn more about wildcard searching, see these back issues of Editorium Update:

http://www.topica.com/lists/editorium/read/message.html?mid=1705963026

http://www.topica.com/lists/editorium/read/message.html?mid=1706069286

http://www.topica.com/lists/editorium/read/message.html?mid=1706167662

http://www.topica.com/lists/editorium/read/message.html?mid=1706267069

http://www.topica.com/lists/editorium/read/message.html?mid=1706365638

http://www.topica.com/lists/editorium/read/message.html?mid=1706458823

Last week's Readers Write column offered one solution to the "Find whole words only" problem: Include a space before and after the words you're looking for. Of course, as the column noted, not every word begins or ends with a space. Words are often preceded or followed by quotation marks, dashes, and other characters, which would require multiple searching and replacing.

That suggests another solution: Use a wildcard "group" that includes every possible character that might precede or follow a word. For example, if we were searching for the word "bet," we could use a group like this before the word in the "Find What" box:

[ "-_/]

That group (preceding "bet") would find the following text:

bet [preceded by a space]

"bet

-bet

_bet

/bet

We'd need a similar group after the word:

[ .,;:!"-_/]

That group (following "bet") would find the following text:

bet [followed by a space]

bet.

bet,

bet;

bet:

bet!

bet"

bet-

bet_

bet/

So our entire "Find What" string would look something like this:

[ "-_/]bet[ .,;:!"-_/]

So far so good, but there ought to be an easier way. How about using a group to specify what *not* to find before and after the word we're looking for--like this:

[!A-z]bet[!A-z]

That string tells Word to find the word "bet" preceded and followed by any nonalphabetic character, which would certainly omit "bet" as part of another word. If we wanted to find "bet" both capped and lowercased, we could use this string:

[!A-z][b,B]et[!A-z]

These approaches are clever, and they will certainly work. In some situations, they (or variations of them) may be the best way to go, which is why I've included them here. However, we also need to remember that Microsoft Word includes a wildcard code for "beginning of word" (<) and "end of word (>)."

So, if we needed to find the whole word "bet" in a wildcard search, we could put this in the "Find What" box:

That string would find "bet" but not "better" or "sorbet"--in other words, it would find "bet" as a whole word only!

Using < and > is probably the most elegant (and the easiest) way to find whole words only while searching with wildcards.

Thanks to Pamela Angulo, Michael C. Coleman for contributing to this article.

_________________________________________

READERS WRITE

After reading last week's article about resizing drop-down lists on toolbars, Steve Hudson wrote:

"I have only one horizontal toolbar which has Style, Font (so I can tell which gallery I am using at the moment), and the file path. I have stretched the file path to its max, which is quite long. I also included undo/redo and highlight on this toolbar as their drop-down nature means they have a non-standard width."

This is a great example of personalizing Word; this toolbar (with its resized lists) sounds most useful. Thanks, Steve.

Pamela Angulo wrote:

"I recently started working in Word 2000. Some things, I like (e.g., I can copy and paste passages with revision marks, and the marks are preserved--yay!). But I got used to working with Draft Font in Word 97, which was a nice sans serif screen font; in Word 2000, the Draft Font appears to be the same as the Default: Times New Roman. (Ick--where's the value added in that?) What's more, in Word 97, italicized text is denoted with an underline; in Word 2000, italicized text is not differentiated in any way. [This is a known "issue" in Word 2000.]

"I'm frustrated. Is there any way to customize the screen font used in Draft Font? If not, is there another way to specify a screen-only font? (My concern is that I often work with files that contain symbols, so a simple Ctrl+A, Format/Font is not an option if I ever want those symbols back.) Is there another option that I haven't thought of?"

Do you, gentle reader, have a solution to Pam's problem? If so, please send it here: mailto:hints [at symbol] editorium.com.

_________________________________________

RESOURCES

The Electric Editors Web site offers macros, email list discussion groups, links to reference tools, and many other resources for editors, especially those who work on the computer. The home page notes, "If you're a professional editor (or anyone with an interest in preparing the written word for publication), the Electric Editors are here to help. On these pages you'll find a comprehensive collection of resources to help you in your work." You can visit the site here:

http://www.electriceditors.net

Resizing Drop-Down Lists

I work a lot with styles in Microsoft Word, and I like being able to look up at the drop-down style list on the formatting toolbar to see the name of the current paragraph style. I also like giving my styles long, descriptive names, such as Normal Text 2, Normal Text 2 No Indent, Normal Text 2 Block Quotation, and so on. The problem is, Word's drop-down style list isn't wide enough to display the entire name of the style, so I usually end up looking at something like this:

Normal Text 2

--even when the name of the style should be displayed like this:

Normal Text 2 Block Quotation

I have the same problem with Word's drop-down font list, especially with font families that have long names and lots of members (Franklin Gothic Book, Franklin Gothic Demi, Franklin Gothic Demi Cond, and so on). Yes, I can click the arrow on the right of the list to see the full name, but I hate reaching for the mouse, especially when all I want to do is display something.

If you, too, have this problem, there's an easy way to fix it. You can resize the drop-down list to show the full name of a style or font:

1. Click the "Tools" menu.

2. Click "Customize." The Customize dialog box will appear.

3. Click inside of the drop-down list you want to resize. A black border will appear around the list window.

4. Move your mouse pointer to the right edge of the list window. Your cursor will change into a vertical bar with arrows sticking out of the sides (indicating that you can resize the window).

5. Click and hold your left mouse button.

6. Move the edge of the list window to the right until the window is the size you'd like it to be. Don't be shy--give yourself plenty of room.

7. Release the mouse button.

8. Click the "Close" button in the Customize dialog box.

Now, isn't that better? You may be surprised at how much frustration this saves from day to day. I know I was.

_________________________________________

READERS WRITE

After reading our article on creating an exclude dictionary, here--

http://www.topica.com/lists/editorium/read/message.html?mid=1709082320

--April Karys wrote:

In creating an exclude dictionary, as I did following your excellent directions, I found out that those of us running on a Mac platform using Word 2001 must save the document not in "text only" or "plain text," but in "speller exclude dictionary." Saving in plain text won't work. [This is also true in Word 98.]

In an article on searching with wildcards--

http://www.topica.com/lists/editorium/read/message.html?mid=1705963026

--I mentioned the fact that wildcard searches can't be set to find whole words only. Callie Jordan wrote with a workaround for this problem:

It's true that Word doesn't have "whole word" as an option, but if you include a space before and after the word(s) you're looking for, it won't find butter when you're looking for b?t--it also won't find "bat" [in quotation marks] though, because that word isn't followed by a space. So there's still a limit. But there aren't as many words in quotes as there are just plain whole words. . . . It also won't find words at the end of a sentence, or with any punctuation. You could just run the Find/Replace a second time and don't do a global replace, verifying each find. There wouldn't be as many words to check after most of them had been replaced.

Thanks to April and to Callie for their useful tips.

_________________________________________

RESOURCES

If you're interested in learning the nitty-gritty details of using Microsoft Word, you can't afford to miss the MVP Word site, which includes tutorials and a great FAQ put together by various people associated with Microsoft's Most Valuable Professional program:

http://www.mvps.org/word

To navigate the site, click the items on the menu bar at the top of the Web page.

Exclude Dictionary

You've just sent a freshly edited manuscript back to your client, but you decide to glance through it one last time. Acck! What's this? "Our company has been highly visible in the pubic arena . . ." How did *that* get through?

It got through because you don't have an exclude dictionary in Microsoft Word. An exclude dictionary is a spell-check dictionary with words that are spelled correctly but that you want to verify during a spell check. If you're editing or writing, you *need* one of these. Here's how to set one up:

1. Create a new document.

2. Type the words (like "pubic") that you want to include (that is, that you want to *exclude* from the spell-checker's list of correctly spelled words).

3. Press the "Enter" key after each word, including the last one.

4. Click the "File" menu.

5. Click "Save As."

6. Navigate to the folder that contains the spell-checker's main dictionary.

In Windows 95, 98, or Millennium Edition (Me), the folder is C:WindowsApplication DataMicrosoftProof.

In Windows 95, 98, or Me with profiles enabled, or in Windows NT 4.0, the folder is C:WindowsProfilesUsernameApplication DataMicrosoftProof.

In Windows 2000 or XP, the folder is C:Documents and SettingsUsernameApplication DataMicrosoftProof.

On a Macintosh, the folder is probably HD:Microsoft Office 2001[or whatever]:Shared Applications:Proofing Tools or HD:System Folder:Preferences:Microsoft.

If you don't save the file to the right folder, your exclude dictionary won't work.

7. In the "Save as type" box, click "Text Only" or "Plain Text."

8. In the "File name" box, type the name for your exclude dictionary. This should be the same name as your main language dictionary but with an ".exc" extension. For example, the English (United States) dictionary in Word 2000 and 2002 is Mssp3en.lex, so the exclude dictionary should be Mssp3en.exc. (In Word 97, the dictionary is named Mssp2_en.lex.) Make sure ".txt" isn't appended to the filename extension (you may need to put quotation marks around the filename to be sure).

9. Click "Save."

10. If the File Conversion dialog box appears, select the options you want to use.

11. Click "OK."

12. Close the document.

13. Close and then restart Microsoft Word.

The next time you do a spell check, the words in your exclude dictionary will be flagged as misspelled, allowing you to review them and avoid future embarrassment. If the exclude dictionary doesn't work, see Word's Help file or go here for possible solutions:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q211639

So, gentle reader, what words do *you* think need to be included in an exclude dictionary? theater/theatre? honor/honour? Do you know of other nasty little surprises like "pubic"? Please email your nominations here:

mailto:editor [at symbol] editorium.com

I'll include them in a future newsletter for all to share.

_________________________________________

READERS WRITE

Ed Nelson (ednelson1@earthlink.net) asked if a "key map" of Microsoft Word's shortcut key combinations is available somewhere. He wrote, "One of the possible virtues of Word is the capacity to program special keys. I understand, however, that many, many are already assigned to some special function by Microsoft. But I find no source to indicate which keys are already assigned to what."

After a little research, I found the following information on Microsoft's Web site. Enjoy!

For PC:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q211982

For Macintosh:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q177184

_________________________________________

RESOURCES

Last week I mentioned Merriam-Webster's Collegiate Dictionary and Thesaurus on CD-ROM. If you don't need the CD-ROM product but still want to look up words electronically from time to time, you'll probably like Merriam-Webster's online dictionary and thesaurus, which you can find here:

http://www.m-w.com

Be sure to check out their other free goodies, including word games, a vocabulary builder, and a browser dictionary button.