in Editing

Wildcard Searching with Tracked Changes

Have you ever put together a clever wildcard Find and Replace routine that you *know* should work, but when you run the routine, you end up with something unexpected? You do it all the time? So do I, but that's not quite what I meant. I'm thinking specifically about routines that use the Find What Text code or the Find What Expression code, which you can learn more about here:

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

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

Let's say you've got a document that has revision tracking turned on (Tools > Track Changes), and in that document is a numbered list, like this:

1. First

2. Second

3. Third

Let's also say you want to use a wildcard Find and Replace to change the list to this:

(1) First

(2) Second

(3) Third

You should be able to do it like this:

1. Click Edit > Replace to bring up Word's Replace dialog.

2. In the "Find What" box, enter this:

([0-9]@)(. )

3. In the "Replace With" box, enter this (with a space after it):

(1)

4. Put a checkmark in the box labeled "Use wildcards."

5. Click the button labeled "Replace All."

But it won't work. What you'll get is a list that looks like this:

1() First

2() Second

3() Third

How frustrating!

The problem is a bug in Word's wildcard Find and Replace engine. The easy way around the problem is to turn off revision tracking before doing the Find and Replace. So there you go!

If you *need* the changes to be tracked, however, you're in trouble. I know of one possible solution:

1. Keep a backup copy of your original document.

2. Do your Find and Replace with revision tracking turned off.

3. Use Tools > Track Changes > Compare Documents to mark the differences between the changed document and your backup copy.

If you're interested in trying this approach, you might want to know that Compare Documents has been much improved in Word 2002. For example, let's say Document 1 contains a bunch of parenthetical figure references, like this:

(Fig. 8)

Let's also say you want to use a wildcard Find and Replace to put bold tags around each one, like this:

(Fig. 8)

With revision tracking turned on, Word 2000 will give you the following, with the bold codes marked as additions and "(Fig. 8)" marked as a deletion (here represented by consecutive hyphens):

--------(Fig. 8)

Word 2002, however, will give you this, pure and simple, with the bold codes marked as additions and no unnecessary deletion:

(Fig. 8)

No matter what version of Word you're using, now maybe the next time you need to use revision tracking with wildcard searching, you can avoid some of the fuss.

Thanks to Karen L. Bojda and Allene M. Goforth for the examples and the idea for this article.

_________________________________________

READERS WRITE

I've received so many great tips from readers that I'm simply not able to include everything in this week's newsletter. My apologies to those who are still waiting; in some cases, I'm holding messages to go with a specific article, so they may not show up for several weeks. Thanks for your patience. And please, keep those tips coming!

After reading about the problems of automatic formatting in Word's Document Map over the past couple of weeks, Phil Rabichow (phrab@earthlink.net) sent some pretty useful tips:

I've been experimenting with the Document Map with Word 2000. Here's what I've found, assuming that you have lines that "look like" headings:.

1. If you open a document with headings already in it, Word doesn't add its own. I know that you've found this to be flaky, and I'm wondering if there are some other "rules" that Word follows.

2. If you open a document with Doc Map turned off, nothing happens, of course. If you then turn on Doc Map, Word autoformats the file. You can press Ctrl+Z once to undo the autoformat and make any edits you want without problems. [Note: This is a major discovery on Phil's part.]

3. If you try to replace Level 1 paragraph formatting with Body Text formatting using Find/Replace, it won't work. You can click Replace All, and Word will tell you that it's making changes, but nothing happens. You must include the style definition (e.g., Normal) in the Replace box in order for it to work. And when you do that, it's not necessary to include a paragraph level in the Replace box for it to work. Once you do a Find/Replace, you can click the Doc Map on and off without Word making paragraph level changes.

4. The only problem comes when Doc Map is turned on when you open a document. Since the Level 1 that Doc Map applies is direct formatting, you can select all (Ctrl+A) and press Ctrl+Q to remove all direct paragraph formatting (and leave all character formatting or styles). This will remove all Word's automatic changes, which isn't a problem provided you haven't applied direct *paragraph* formatting yourself to other parts of the document.

Many thanks to Phil for his comments and suggestions.

_________________________________________

RESOURCES

OfficeZealot ("where Office zealots come to play . . ." ) is a great-looking site featuring all kinds of information about your favorite word processor and its siblings:

http://officezealot.com/