Jack Lyon

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/

Unlinking Headers and Footers

If you work much with headers and footers in Microsoft Word, you've probably noticed that when you insert a section break, it's automatically set to "Same as Previous." For many Word users, especially in the publishing world, this is an annoyance. If I'm creating a new chapter in a book, I want my headers to be *different* from those in the previous chapter, not the same. Ideally, there should be a way to set this (or not) as an option:

[] Automatically set headers and footers to "Same as Previous"

As far as I know, this option doesn't exist. If you know otherwise, please let me know, and I'll include your tip in next week's newsletter. In the meantime, here's a macro that will go through a document's headers and footers and unlink them all:

'THE MACRO STARTS HERE
Dim curSection As Section, curHeader As HeaderFooter
For Each curSection In ActiveDocument.Sections
For Each curHeader In curSection.Headers
curHeader.LinkToPrevious = False
Next curHeader
Next curSection
'THE MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn here.

The macro won't set the option permanently, but at least you'll no longer need to unlink all of your headers and footers by hand.

Thanks to Susan Bullowa for suggesting this topic.

_________________________________________

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 last week's exchange about automatic formatting in Word's Document Map, Hilary Powers wrote:

After describing the problem of non-heading items showing up in the Document Map, and restoring themselves to it after being removed by a VBA routine, Bill Fosbury wrote:

I will

* run my program to change the outline level to "body text"

* then add the headings that I want

* the next time I open the file the document map builder will be happy

the next time I open the file because I will have some heads and I will

therefore not look for candidates.

To which Jack Lyon writes:

What you've said makes perfect sense. Document Map can't work unless it

has something to work with. So if it doesn't, rather than just sit there

blank (and leave the user wondering why nothing's happening), it

autoformats the document so it *will* have something to work with....

That's certainly the way it looks like it's working, or at least ought to work, but it's not. At any rate, I too have a charming little VBA routine that gets rid of garbage on the Document Map. And when I save the file and reopen it, all the garbage is back. But. Garbage appears unpredictably, whether or not a file has headings defined using Word styles, and as far as I can tell, once a file develops that sort of garbage it never loses it permanently. Meanwhile, if no lines in a file look like headings, the Document Map will show up with nothing in it; it doesn't have to find something and put it up. Nobody's found a fix for this over on the Word-PC list; I've just got the cleaner on a hot key and run it as needed.

I'm not certain if the Document Map ever lets go of stuff it's defined--it may well do so, as many files never develop garbage. But just defining a set of headings is no guarantee that it won't go its own cluttered way....

_____________________

After reading last week's article on automatic dashes, my longtime friend Richard O'Regan wrote:

I disagree with you on the use of the en dash. At least, over here, in "old Europe," the en dash, preceded and followed by a space, is used both in the UK and on the Continent. The em dash no longer sees the light of day.

_____________________

Lindy M wrote:

I share your preference for the em dash rather than the spaced en, but I do use the latter, for one reason: it's easier to control line breaks. With a nonbreaking space before the en dash I can ensure it always breaks at the end of a line rather than at the beginning. I can't find any way to attach an em dash to the end of a word other than spacing it, which would look excessive to my eye. I might add that some people firmly believe that dashes should appear at the beginning of a line, not the end. I don't. I should also confess that I use Word as little as possible. From what I've seen it handles em dash breaks elegantly, but some other word processors and page layout programs need help with this sort of thing, especially older versions.

Thanks to all for their comments and suggestions.

_________________________________________

RESOURCES

I've been almost in despair about what to do about spam. Then here comes an email message from my Aussie mate Steve Hudson, who pointed me to Cloudmark's free SpamNet program:

http://www.cloudmark.com/products/spamnet/

Unlike other such programs, this one uses the power of distributed computing to identify and block spam. It's not foolproof, but it's sure caught an awful lot of spam for me. Check it out!

Automatic Dashes

Helpful as always, Microsoft Word will automatically insert em dashes for you--but with an interesting twist. I'll tell you what it is in just a minute. But first, here's how to turn on those automatic dashes if you want to use them:

1. Click the Tools menu.

2. Click "AutoCorrect."

3. Click the tab labeled "AutoFormat As You Type."

4. Under "Replace as you type," put a check in the box labeled "Symbol characters (--) with symbols (--)."

5. Click the OK button.

To see how the feature works:

1. Create a new document and type in a word.

2. After you've typed the word, don't hit the spacebar; instead, type two hyphens in a row.

3. Once again, don't hit the spacebar; instead, type another word.

4. *Now* hit the spacebar.

Wow, your two hyphens have turned into an em dash! What, you already knew you could do that? Okay, here's the interesting twist:

1. Create a new document and type in a word.

2. After you've typed the word, *do* hit the spacebar.

3. Type a single hyphen.

4. Hit the spacebar again.

5. Type another word.

6. Hit the spacebar again.

Wow, your single hyphen has turned into an en dash! What's going on here?

In the world of typography, there are several kinds of dashes, each with a different length. As the Chicago Manual of Style (5.105) notes, "There are en dashes, em dashes, and 2- and 3-em dashes. . . . Each kind of dash has its own uses." Chicago specifies that the em dash should be used to indicate "sudden breaks and abrupt changes" and "amplifying, explanatory, and digressive elements."

Some designers, however, beg to differ. Instead of using an em dash, they use an en dash surrounded by spaces. Robert Bringhurst argues for this in his book The Elements of Typographic Style (p. 80):

"The em dash is the nineteenth-century standard, still prescribed in many editorial style books, but the em dash is too long for use with the best text faces. Like the oversized space between sentences, it belongs to the padded and corseted aesthetic of Victorian typography. Used as a phrase marker - thus - the en dash is set with a normal word space either side."

In my opinion, Bringhurst is wrong. The whole point of the em dash is to indicate an abrupt change, and a long dash does that better than a short one. That's why Messrs. Garamond, Goudy, and Gill *designed* long dashes for their typefaces, fer cryin' out loud. The shorter en dash surrounded by spaces may look "prettier," but it is also less forceful, and form should follow function. That's my take on it, anyway.

The interesting thing is that Microsoft seems to be trying to accommodate *both* usages. If you type two hyphens in a row, you'll get an em dash. If you type space, hyphen, space, you'll get an en dash with spaces. Chicago or Bringhurst, take your pick. Thanks, Microsoft!

You can learn more about the Chicago Manual of Style here:

http://www.press.uchicago.edu/cgi-bin/hfs.cgi/00/12245.ctl

And you can learn more about The Elements of Typographic Style here:

http://www.typebooks.org/r-elements.htm

Thanks to Steve Hudson for suggesting this topic.

_________________________________________

READERS WRITE

Bill Fosbury wrote:

I saw "Content vs preparation" at:

http://www.planetpublish.com/mainpage.asp?webpageid=231

It talks about the Document Map and the Outline Level.

I have the opposite problem. After saving a Lotus WordPro file as a MS Word file, I opened it in Word and saw lots of unwanted stuff in the Document Map. After spend several hours experimenting I discovered the Outline Level and changed it BACK to "Body text". The item disappeared from the Document Map. Since I had so many to change, I figured out how to write some Visual Basic code to change all of them. That worked fine:


Public Sub RemoveFromDocumentMap()
Dim aParagraph  As Paragraph
For Each aParagraph In ActiveDocument.Paragraphs
aParagraph.Range.ParagraphFormat.OutlineLevel = wdOutlineLevelBodyText
Next
End Sub

BUT, after saving the file and then reopening it, good old Word changed the Outline Level for all those chunks of text BACK to "Level 1".

A few hours later I came to the realization about what I think is happening and now have a solution. Following this path in Help:

Help

Answer Wizard

search: document map

"Troubleshoot working with the document map"

select: "The Document Map doesn't display some or all of the document's headings."

brings one to this key sentence: "If Word can't find any headings formatted with the heading styles or outline levels, it automatically searches the document for paragraphs that look like headings "

My file does NOT contain any headings (yet).

I read that sentence many times but its significance had not set in.

This is what is happening:

* there are no headings in my document

* when my program changes the outline level to "body text" that removes ALL document map candidates.

* everything disappears for the document map

* when I close and reopen the file, that key sentence comes into play

* since there are NO HEADINGS, it searches for candidates, as that sentence says, and it brings back everything that my program had gotten rid of.

I will

* run my program to change the outline level to "body text"

* then add the headings that I want

* the next time I open the file the document map builder will be happy the next time I open the file because I will have some heads and I will therefore not look for candidates.

After reading Bill's message, I responded:

What you've said makes perfect sense. Document Map can't work unless it has something to work with. So if it doesn't, rather than just sit there blank (and leave the user wondering why nothing's happening), it autoformats the document so it *will* have something to work with. Very typical of Microsoft's general "friendliness" that ends up causing problems rather than solving them. A better approach would have been for Word to say something like "Your document has no headings styles that can be displayed in Document Map. Please apply heading styles and try again." Oh, well.

Thanks to Bill for the useful information.

_________________________________________

RESOURCES

The Get It Write tip archive offers this useful advice on using dashes:

http://www.getitwriteonline.com/archive/091502.htm

But it also offers many other articles for writers and editors:

http://www.getitwriteonline.com/archive/tips.htm

Want tips delivered free by email? You can sign up here:

http://www.getitwriteonline.com/signup.cfm

Word in Your Pocket

About a year ago, after much back-and-forthing, I finally broke down and bought a Pocket PC--an AudioVox Maestro. Much to my surprise, I loved it, although I was vastly disappointed in the pocket edition of Microsoft Word. Sure, it could open the Word documents I was editing on my desktop computer, but it stripped out such advanced features as footnotes and even styles, dashing my hopes that it could be used for serious editing on the go.

Then, a couple of months ago, I started hearing about a Pocket PC word processor that emulated many of Word's features. Its name was TextMaker, from a company called SoftMaker. I downloaded the trial version, not really expecting it to amount to much. Boy, was I wrong. This program is so impressive I decided I had to tell you about it--not because I have any financial interest in it (I don't) but because it makes an excellent editing system for Microsoft Word documents when you're away from your desktop. (I'm using the program to write this article.)

TextMaker works very much like Word, right down to the red squiggles under misspelled words. Here's a partial list of features:

* paragraph and character styles

* footnotes and endnotes

* find and replace

* multilanguage spell checking

* thesaurus

* indexing

* tables of contents

* headers and footers

* graphics support

* hidden text

* columns

* bookmarks

* symbol characters

* frames

* merge

* tables and sorting

* borders

* automatic hyphenation

TextMaker has all this and more, on a Pocket PC, with the look and feel of Microsoft Word--only smaller! The find and replace feature even includes limited wildcard searching, and it also allows you to search for formatting (including styles) as well as text. Round-tripping between TextMaker and Word on my desktop is flawless except for one thing--TextMaker doesn't do revision tracking (it imports revisions as underline and strikethrough). Ah, well. I guess I can't expect perfection. But TextMaker comes awfully close.

You can learn more about TextMaker here:

http://www.softmaker.de/tmp_en.htm

There are three other programs that really make a Pocket PC worth having. One is Fitaly, which makes entering text a cinch. Use it with the Pocket PC's autocompletion feature and you'll understand how I was able to write this whole article using a stylus. You can learn more about Fitaly here:

http://www.fitaly.com/wince/pocketpcfitaly.htm

Another is Pocket Informant, an information manager. I use it to keep track of publishing schedules and editing tasks, and there's really no similar program that has anywhere near its flexibility and power.

http://www.pocketinformant.com/PocketInformant.php

Finally, there's the free Microsoft Reader that comes with a Pocket PC. When I bought mine, I didn't realize that one benefit would be almost instant, free access to thousands of downloadable books. There are many sources for these, but here are a couple of my favorites:

http://www.blackmask.com/page.php

http://www.bartleby.com/ebook/

Not all books are free, of course, and many nice electronic versions are well worth paying for. Check out the terrific commercial offerings (including my book Total Word Domination) at PocketPCpress:

http://www.pocketpcpress.com/

Note that you can make your own Microsoft Reader books (a nice way to review manuscripts) with a free Microsoft Word add-in that you can download here:

http://www.microsoft.com/reader/downloads/rmr.asp

Have I convinced you yet? If so, you might want to look at the beautiful e750 Pocket PC from Toshiba, which you can learn about here:

http://www.pdabuyersguide.com/toshiba_e750.htm

Don't need that much horsepower (or price)? Maybe you'd like the ViewSonic V35:

http://www.viewsonic.com/products/pocket_pc_pocketpcv35.htm

You can read about and compare lots of Pocket PCs here:

http://www.pdabuyersguide.com/ppc.htm

_________________________________________

RESOURCES

SoftMaker is making a very generous offer to you as a reader of Editorium Update. They're willing to *give* you a complimentary, registered copy of TextMaker for your *desktop* computer (no kidding) so you can see what this wonderful program has to offer. It has all the features of the Pocket PC version, as described above, with a current retail price of $49.95, but you'll get it at no charge and with no strings attached. This is a *great* word processor, powerful and light on its feet, and it's extremely compatible with Microsoft Word. Better get it while you can. You can learn more here:

http://www.softmaker.de/freetm.htm

Want to tell your friends? It's okay to do so, but I'd appreciate the courtesy of letting them know about Editorium Update rather than just sending them the URL above. After all, SoftMaker made their offer specifically to readers of Editorium Update. So why not help your friends become readers? Then they can take advantage of this offer too! Signing up for the newsletter is easy. Just send a blank email message to editorium-subscribe [at symbol] topica.com. Thanks for your consideration and support.

Character Styles Macro

Most Microsoft Word users who need to use bold or italic just press CTRL + B or CTRL + I and go blithely on their way, not thinking any more about it. But at some point, they'll run into problems. For example, their directly applied formatting may disappear when they apply a paragraph style over the top of it. You can read more about this here:

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

Another example is that sometimes directly applied formatting simply refuses to be found with Word's Find feature. I don't know why that is, but I've seen it time after time.

The solution to such problems is to avoid using directly applied character formatting entirely. Instead, use character *styles* formatted as bold or italic. Unfortunately, doing so isn't nearly as easy as using plain old character formatting--until now. I'm providing a macro that will create the character style you need and then toggle between bold and roman, italic and roman, or other formatting using Word's built-in keyboard shortcuts and toolbar buttons. Pretty slick! Here's the macro for italic:

'THE MACRO STARTS HERE
Dim Found, myStyle
Found = False
For Each myStyle In ActiveDocument.Styles
If myStyle.NameLocal = "Italic" Then
Found = True
Exit For
End If
Next
If Found = False Then
ActiveDocument.Styles.Add _
Name:="Italic", _
Type:=wdStyleTypeCharacter
ActiveDocument.Styles("Italic").BaseStyle = _
"Default Paragraph Font"
ActiveDocument.Styles("Italic").Font.Italic = True
End If
mySel = Selection.Font.Italic
If mySel = wdUndefined Or mySel = False Then
Selection.Style = "Italic"
Else
Selection.Style = "Default Paragraph Font"
End If
'THE MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn how here.

The first part of the macro (from "For Each" to "Next") checks to see if the character style (in this case named "Italic") already exists. If it does, the macro leaves it alone, which means you can create and format your character styles any way you like so they will work with this macro. If the character style *doesn't* exist, the macro creates it with the appropriate formatting (in this case, italic--note the line that says "ActiveDocument.Styles("Italic").Font.Italic = True").

The second part of the macro checks to see if any part of the selection (which may be selected text or simply the text at the cursor position) is already formatted as italic. If it's not (or if part of it is), the macro applies the Italic character style. If the selection is already italic, the macro applies the Default Paragraph Font to make the selection roman.

You've probably already figured out that you can modify the macro to take care of bold, underlining, or other kinds of formatting. To do so, you'll need to change "Italic" to "Bold" (or whatever) wherever it appears in these six lines of the macro:

If myStyle.NameLocal = "Italic" Then

Name:="Italic", _

ActiveDocument.Styles("Italic").BaseStyle = _

ActiveDocument.Styles("Italic").Font.Italic = True

mySel = Selection.Font.Italic

Selection.Style = "Italic"

Note that in the following line, you'll have to change it twice:

ActiveDocument.Styles("Italic").Font.Italic = True

In making your changes, you can use Bold, Italic, Underline, SmallCaps, AllCaps, Superscript, Subscript, Strikethrough, Hidden, Outline, or Shadow. (A few other formats are also available; if you're interested, see the "Properties" listing for "Font Object" in Word's Visual Basic Help file.)

There's one more line you might be interested in modifying:

"Default Paragraph Font"

You can change this line to the name of an actual font you want to use (for example, "Baskerville"). This is useful if you want to specify the name of a true italic font to provide italic formatting or to get fancy in other ways.

To get the macro to work when you press one of Word's built-in keyboard commands (such as CTRL + I) or toolbar buttons, simply give the macro the same name as the Word command. For example, if you name the macro "Italic," like this--


Sub Italic()

--then Word will happily treat it just as if it were the built-in Italic command! For your convenience, the names of Word's built-in character formatting commands are Bold, Italic, Underline, SmallCaps, AllCaps, Superscript, Subscript, Strikethrough, Hidden, Outline, and Shadow.

After you've used the macro to apply formatting to some text, you'll see the name of the character style (such as "Italic") in the Styles list on the Formatting toolbar.

Here's an equivalent macro for Word 6 or 95; notice that the formatting is set with "1" or "-1" in case you want to change it:

'THE MACRO STARTS HERE
If StyleDesc$("Italic") = "" Then
FormatStyle .Name = "Italic", 
.BasedOn = "Default Paragraph Font", 
.Type = 1, .AddToTemplate = 0, .Define
FormatDefineStyleFont 
.Bold = - 1, 
.Italic = 1, 
.Underline = - 1, 
.SmallCaps = - 1, 
.AllCaps = - 1, 
.Superscript = - 1, 
.Subscript = - 1, 
.Strikethrough = - 1, 
.Hidden = - 1, 
.Outline = - 1, 
.Shadow = - 1, 
.Font = "(normal text)"
End If
If Italic() <> 1 Then
Style "Italic"
Else
Style "Default Paragraph Font"
End If
'THE MACRO ENDS HERE

Thanks to Steve Hudson for VBA advice.

_________________________________________

READERS WRITE

Susan Bullowa wrote:

If you have the Styles and Formatting Task Pane open In Word 2002 and you hover the arrow cursor over the paragraph mark to the right of the style name, the tool tip with all of the style's attributes appears. I find the tool tip information useful because it usually displays more detail than the listing of attributes in the Modify Styles dialog box. When the tool tip appears and I want to record the information, I press the Print Scr button and paste the picture into Paint. In that way, I can print the information for myself while I build my spreadsheet of style attributes.

Thanks to Susan for the useful tip.

_________________________________________

RESOURCES

Want to learn more about using styles? Check out Microsoft's "Tips for Understanding Styles in Word":

http://www.microsoft.com/office/using/column14.asp

Go Tell Microsoft!

Several readers have written to complain about Microsoft's "enhancements" of various features in Word 2002. Most notably, the Comments and Revision Tracking features are broken. I've written about these here:

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

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

Reader Ned Humphrey suggested starting a campaign to get Microsoft to reverse itself on such "disimprovements," which I thought was a great idea. So gentle reader, if you're so inclined, I'd like to enlist your help in asking Microsoft to change Comments and Revision Tracking back to the way they worked in Word 2000--or at least to give us the option of having them work the old way. Are you with me? ARE YOU WITH ME? (Sorry, I got a little carried away there.)

If you are, or if you have any other suggestions you'd like to give to Microsoft, you can do so here:

http://support.microsoft.com/default.aspx?scid=fh;[ln];feedback

Microsoft is asking for feedback, and I say we should give it to them. Please take a minute to click on the link above and send Microsoft your ideas. If we all work together, we should be able to help make a great word processor even better. And if you've ever wondered how to go about giving feedback to Microsoft, now you know how. Thanks for your help.

_________________________________________

READERS WRITE

Hilary Powers sent a correction to her serial comma macro that appeared in last week's newsletter. She wrote:

Everybody needs an editor. Turns out there's a mistake in my macro as presented--it won't ignore "andiron" at all. It needs to look like this instead:

'THE MACRO STARTS HERE
'Serial Macro
'Macro written 02/27/03 by Hilary Powers; updated 3/12
'
Selection.Find.ClearFormatting
With Selection.Find
.text = "and"
' REMOVED LEADING SPACE IN SEARCH STRING
.MatchCase = True
.MatchWholeWord = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=2
' BACK UP TWO SPACES BEHIND SEARCH STRING TO MAKE UP FOR DELETED SPACE
Selection.TypeText text:=","
'THE MACRO ENDS HERE

I didn't spot the problem until I contemplated the version in the newsletter and started wondering how it can find "whole words" on a string containing a space. I wrote that bit in rather than recording it, and the macro works without complaint--but it turns out that the string simply overrides that provision. So everything's fine as long as the next "and" string really is a whole word, but if it's not--a rare but possible thing--you get a comma there anyway.

If you don't know how to use macros like the one sent by Hilary, you can learn how here.

___________________________

Marty Spitzenberger sent in a way to insert serial commas using a wildcard Find and Replace. He wrote:

Type "([!,]) and>" (without the quotes) in the Find what field, and "1, and" in the Replace with field. Check the "Use Wildcards" box. Do Find Next. If the found text needs a comma, then do Replace. Since another Find Next is automatically performed after the Replace, exit the dialog box and do to return to the point of text replacement so the manual review can continue. This sequence can be recorded and saved as a macro.

The Find What text above translates to the following: find a group of one character that is not a comma, followed by one space character, followed by "and", which is the end of the word. This approach avoids a match to something like "black andirons."

Obviously, this will still find "Jack and Jill", which doesn't need a comma, but then so does last week's macro. This approach does avoid the extra steps in the macro of moving the cursor to the end of the previous word to insert the comma. The Replace With text translates to: replace the selection with the found group/character that wasn't a comma, then a comma followed by a space character and "and".

An improved search string would find sentences with a serial comma error in the form "I like a, b and c." This wildcard Find What string is:

(, [!.,:!?^013]@) and>

This search string finds the following sequence of characters:

a comma,

a space,

one or more characters that do not include period, comma, colon, exclamation mark, question mark, or paragraph mark

a space,

"and", which is the end of the word

The appropriate Replace With string is unchanged:

1, and

The search string limits the found text to appearing within one sentence of one paragraph, where the sentence contains a comma and then some other text without a comma immediately before " and". This way the search string avoids finding sentences in the form of "I like a and b." While it will incorrectly find sentences in the form of "Sadly, I like a and b.", it is still an improvement.

Another frequent task that can be simplified through wildcard search and replace is the deletion of extra paragraph marks inserted when a word-wrapped paragraph is converted to plain text. For example, my email as attached to your reply now has "> " at the beginning of each line and a paragraph mark at the end of each, with many short lines. Although transforming this text back into nice, word-wrapped paragraphs takes several steps, it is still quicker than doing each replacement manually:

1. Obviously, copy the desired text into a new word document.

2. Remove all of the "> " at the beginning of each line with this:

Find What: ^p>^032

(You can use a space character in place of the ^032 used here and elsewhere. I'm using ^032 to ensure that you enter a space.)

Replace With: ^p

Disable "Use wildcards"

Do Replace All

Note: The ^p at the beginning of the Find What is needed to avoid deleting a "> " string contained within paragraph text, which occurs here in the text representing key labels.

3. Review the text to ensure that there is a tab character starting each paragraph or a blank paragraph following each desired paragraph. Add any that are missing.

Note: Replacements in steps 4 and 5 are done to replace the paragraph mark with a space if a space isn't already before or after the para mark. The Find string also avoids replacing the paragraph mark if it is followed by a tab, under the assumption that this is an indented paragraph or a bullet.

4. Find What: ([!^013^032])^013([!^013^t^032])

Replace With: 1^0322

Check "Use wildcards"

Do Replace All

5. Find What: ([!^013])^013([!^013^t])

Replace With: 12

Check "Use wildcards"

Do Replace All

___________________________

Linda Duguay wrote:

I was recently faced with a request to create a macro to get rid of multiple blank lines in a document. This could happen when a document comes in as a text file or during a merge etc. I brought out my trusty book, Total Word Domination, that you wrote and went to work on the problem using wildcards.

A caveat in this case: there were blank lines between paragraphs (it was a text file so no paragraph spacing) and we wanted to delete them (the first Find command). But we didn't want to delete the actual carriage return at the end of the paragraph, so we searched for two carriage returns and replaced them with one. With all of the double carriage returns out of the picture, we could now search for all occurrences of three or more carriage returns and delete those (the second Find command). It was very fast and did the job. We had over 1,000 pages reduced to 1 page in seconds.

In the case where you want two carriage returns to separate paragraphs, you can either not use the first Find routine or using a message box to ask if this is wanted.

Here is what I came up with:

'THE MACRO STARTS HERE
Dim myRange As Range
ActiveDocument.Bookmarks.Add Name:="TempDBP", Range:=Selection.Range
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^13{2}"
.Replacement.Text = "^13"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.HomeKey Unit:=wdStory
With Selection.Find
.Text = "^13{2,}"
.Replacement.Text = ""
.Forward = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With ActiveDocument.Bookmarks("TempDBP")
.Select
.Delete
End With
'THE MACRO ENDS HERE

___________________________

From: Phil Rabichow [mailto:phrab@earthlink.net]

The last issue of Editorium pointed out that you can search for ^013 when you're looking for a paragraph mark. You can also use ^13 (just one keystroke less, I know). Anyhow, here is a list of Find/Replace codes:

These you can use when you don't use wildcards:

^p Paragraph mark

^t Tab character

^a Annotation (comment) mark

^0nnn ANSI (4 digit) or ASCII (3 digit) characters, where nnn is the character code

^? Any character

^# Any digit

^$ Any letter

^^ Caret character

^c Clipboard contents

^& Contents of the Find What box

^e Endnote mark

^d Field

^f Footnote mark

^g Graphic

BREAKS

^n Column break

^l Line break

^m Manual page break

^b Section break

HYPHENS AND SPACES

^+ Em dash

^= En dash

^s Nonbreaking space

^~ Nonbreaking hyphen

^- Optional hyphen

^w White space

Here is a list that you can use in Find when using wildcards:

^1 Picture (Except pictures with Float Over Text property, Word 98

Macintosh Edition)

^2 Auto-referenced footnotes

^5 Comment mark

^9 Tab

^11 New line

^12 Page OR section break

^13 Carriage return

^14 Column break

^19 Opening field brace (when the field braces are visible)

^21 Closing field brace (when the field braces are visible)

^? Word 6.x and later: Any single character (not valid in the Replace

box)

^- Optional hyphen

^~ Non-breaking hyphen

^^ Caret character

^# Any digit (Word 6.x and later)

^$ Any letter (Word 6.x and later)

^& Contents of Find What box (Replace box only) (Word 6.x and later)

^+ Em Dash (not valid in the Replace box) (Word 6.x and later)

^= En Dash (not valid in the Replace box) (Word 6.x and later)

^u8195 Em Space Unicode character value search (not valid in the

Replace box)

^u8194 En Space Unicode character value search (not valid in the

Replace box)

^a Comment (not valid in the Replace box) (Word 6.x - Word 7.0)

^b Section Break (not valid in the Replace box) (Word 6.x and later)

^c Replace with Clipboard contents (Replace box only)

^d Field(Word 6.x and later)

^e Endnote Mark (not valid in the Replace box) (Word 6.x and later)

^f Footnote Mark (not valid in the Replace box) (Word 6.x and later)

^g Graphic(Word 6.x and later)

^l New line

^m Manual Page Break (Word 6.x and later)

^n Column break (Word 6.x and later)

^t Tab

^p Paragraph mark

^s Non-breaking space

^w White space (space, non-breaking space, tab; not valid in the

Replace box)

^nnn Where "n" is an ASCII character number

^0nnn Same as above, but uses ANSI characters (ALT+nnn PC only)

^unnnn Word 97 Unicode character search where "n" is a decimal number corresponding to the Unicode character value.

Thanks to one and all for their useful suggestions.

_________________________________________

RESOURCES

If you haven't yet signed up for Allen Wyatt's wonderful WordTips newsletter, you're missing some of the best tips and tricks around. The perfect complement to Editorium Update, WordTips provides a weekly helping of quick, helpful hints for beginners and experts alike. You can learn more and sign up here:

http://www.vitalnews.com/wordtips/

Wildcard Carriage Returns

I've occasionally mentioned this in passing, but based on recent questions from readers, it seems worth making a fuss about: Yes, you *can* use a carriage return in a wildcard search.

People who use Microsoft Word often get stymied by this. They try doing a wildcard search with a string like this one:

^pSee(*)^p

What do they get? An error message: "^p is not a valid special character for the Find What box or is not supported when the Use Wildcards check box is selected."

Then they give up: "Dang! Guess I can't look for carriage returns in a wildcard search." In the immortal words of Winston Churchill, "Never, never, never give up." There's almost always a solution if you'll just hang in there and look for it. In this case, the solution is to use the ASCII character code for a carriage return. That code is:

^013

So our theoretical wildcard search would look like this:

^013See(*)^013

And that will work--unless you're using a Macintosh. On a Mac, Word simply won't find anything or (as just happened to me when I was testing this) your computer will lock up. But, surprisingly, there is a solution, which took a considerable amount of messing around to figure out. Use the ^013 but "escape" it with a backslash and treat it as a range with square brackets. In other words, use this:

[^013]

If you're a Mac user, you know what a breakthrough that is.

Finally, a caution: If you're *replacing* with carriage returns, don't use the ASCII code. Instead, use the good old paragraph code, ^p. Why? Because ^013 and ^p are not the same thing. ^p is a Word carriage return, and as such it holds formatting information that ^013 doesn't. If you replace with ^013, that formatting may be lost.

Want to know more about wildcard searching? See David Varner's comment and my response in today's Readers Write column.

_________________________________________

READERS WRITE

David Varner wrote:

"I wanted to bring up your mention of wildcard searching as a skill. You said it 'may be the most important tool you can acquire.' Okay, I've read all your articles and tried the different tips. Heck, I've printed out all the articles. But it's not the same as having one dedicated wildcard text source. And so the question is, any chance you can point me to (or create/compile) a clear and straightforward, whole enchilada wildcard search and replace manual? Or maybe I could just cut and paste all your wildcard Editorium Updates together!"

I responded to David that I'd already done this, in a document named "Advanced Find and Replace in Microsoft Word." I sent the document to him, and I'm making it available as a free download for anyone else who wants it. This document is worth your time, believe me. You can start the download by clicking here:

http://www.editorium.com/ftp/AdvancedFind.zip

I'd like to thank Bob Janes for formatting and editing the document and especially for compiling the reference section at the end.

___________________________

After reading my philosophical ramblings on the value of technical literacy in last week's newsletter, Dan A. Wilson sent this terrific comment. Thanks, Dan!

"In business talks and seminars aimed at corporate climbers and white-collar execs in the past several years, I've begun including this phrase at opportune times:

"'Time was, and not too long ago, that the value of an individual to an organization increased geometrically when he or she became computer-literate. Today, literacy at the computer no longer pulls much weight: you have to be computer-sophisticated today, and that means simply that you must have come to regard the computer as far and away your most valuable tool, your ultimate enabler, your brain's second-in command. A brain with a pencil in its hand cannot compete--indeed cannot even credibly challenge--a brain with a computer and computer-sophistication at its disposal. Regarding the machine as an enemy, an obstacle, an unnecessary complication is lethal, and the individual who has that view of the computer is at least dying, if not already dead, in the world of business affairs, but probably doesn't yet know it.'"

___________________________

In the February 26 newsletter, I asked readers to send in their hyphenation exception dictionaries to share with the rest of the world. Rebecca Evans (evansreb@earthlink.net) actually did! Thanks, Rebecca! The dictionary is available for download here:

http://www.editorium.com/ftp/Exceptionary.zip

Here are Rebecca's comments on the dictionary:

"This is the hyphenation exception dictionary I currently use with Ventura. Ventura lets me specify how many letters must appear before a hyphen at the beginning of a word and how many after at the end so some of the words show hyphenation points at places I would not actually allow.

"In Ventura, words in the exception dictionary shown without hyphenation points are words that Ventura is told not to hyphenate at all. I use this for words that hyphenate differently depending on usage, such as pro-ject and proj-ect. I also place unhyphenated words in here to prevent unfortunate breaks, such as anal-ist.

"The words in this exception list also don't include every possible hyphenation point because I use this list to force preferred hyphenation, such as dem-onstrate instead of demon-strate.

"Microsoft Word and Ventura mis-hyphenate differently, I would imagine, so many of these words may hyphenate properly in Word. In fact, I've been using this list for so long now (so many versions of Ventura) that many of these may actually hyphenate properly in Ventura."

___________________________

Hilary Powers sent in a terrific macro for working with serial commas. Thanks, Hilary! Here are her comments, followed by the macro:

"Remember I asked awhile back about automating the placement of serial commas? This doesn't do the whole job, but it takes a lot of the curse off of the problem of dealing with an AP author who's writing for a Chicago publisher.

"It goes to the next instance of the word 'and,' backs up a space, and puts in a comma--ignoring 'And' and 'andiron' and the like. (I may do a partner for 'or' one day, but that doesn't come up nearly as often.)

"I have it assigned to the hot key Alt-/ and to a voice macro pronounced 'seer-comm.' So when I'm reading along and I see a spot that needs a serial comma coming up, I just say or key the command and the comma appears where it belongs, without the need to mouse to the exact spot. And if there was another 'and' in the way that I missed seeing, well, that's what Ctrl-Z is for."

'THE MACRO STARTS HERE
'Serial Macro
'Macro written 02/27/03 by Hilary Powers
'
Selection.Find.ClearFormatting
With Selection.Find
.text = " and"
.MatchCase = True
.MatchWholeWord = True
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText text:=","
'THE MACRO ENDS HERE

If you don't know how to use macros like that one, you can learn how here.

_________________________________________

RESOURCES

Steve Hudson is making his consulting and training services and Microsoft Word spellbooks and macro packages available at his new Web site, here:

http://www.geocities.com/word_heretic/products.html

Check it out! A great way to improve your technical literacy.

Technology

John Henry was hammering on the right side,
The big steam drill on the left,
Before that steam drill could beat him down,
He hammered his fool self to death.

American folk song "John Henry" pits man against machine in drilling a tunnel for the railroad. John Henry wins the contest, but the effort costs him his life.

You probably won't see that song on Billboard's Top 40 list, but its theme is still with us, as shown in the recent rematch between chess master Gary Kasparov and IBM's Deep Junior chess program. The Associated Press article for February 9 described the final moments:

"Kasparov played himself into a superior position but offered a draw on the 23rd move, surprising chess experts at the New York Athletic Club. Deep Junior turned down the offer but presented its own draw five moves later, and Kasparov readily accepted to boos from the crowd.

"Kasparov said he played better than Deep Junior in the deciding game and would have pressed for a win in a similar position against a human opponent. But, he said, he feared even a tiny mistake would have been severely punished by the computer."

Do you view technology as an opponent? For many editors, the answer is yes. Editors, indexers, and other publishing professionals seem extremely conservative about technology--perhaps with good reason. Their job is to ensure accuracy, clarity, and even beauty--and that requires a human mind. Editors are right to resist anything that gets in the way of those goals. And managers who believe that a spell check is as good as an edit or that a machine-generated concordance can take the place of an index need to be educated about the realities of the marketplace--realities that will surely come back to bite them if ignored.

It is also true, however, that editors who ignore the need to use technology do so at their peril. The field of publishing is changing rapidly, and editors have got to keep up. If they don't, they'll be replaced--not by machines but by other editors who know how to use machines to their advantage.

I'm tempted here to give my lecture about how the lowly plow made civilization possible, with a recapitulation of Adam Smith's Wealth of Nations and the overwhelming role of technology in human progress. But I won't. Instead, I will ask you: What have you learned this week about using your computer to help you do your job more efficiently? If your answer is "Nothing," may I encourage you to check out our newsletter archive, where you'll find a wealth of information about editing in Microsoft Word.

I especially encourage you to read the articles on wildcard searching and replacing, which may be the most important tool you can acquire. If that's not enough, pay a visit to the Word MVP site, where you'll find tips and techniques aplenty.

Finally, ask yourself: "What one thing could I do with my computer that would dramatically increase my effectiveness?" Then find out how to do it.

Michael Dertouzos, late director of MIT's Laboratory for Computer Science, had a slogan that I like: "Doing more by doing less." And Nolan Bushnell, founder of Atari, said, "I believe that . . . a person today who is computer literate is twenty times more valuable than someone who is not because they're facilitated. It's like they have three robots working for them."

The truth is, you don't have to beat the machine; all you have to do is put it to work.

To learn more about John Henry:

http://www.ibiblio.org/john_henry/index.html

To learn more about the Kasparov matches:

http://www.research.ibm.com/deepblue/home/html/b.html

http://www.wired.com/news/culture/0,1284,57607,00.html

To read Wealth of Nations:

http://www.econlib.org/library/Smith/smWN.html

To learn about the history of civilization:

http://www.humberc.on.ca/~warrick/0hist.html

For a lighter look at that history:

http://www.csc.twu.ca/rsbook2/Ch1/Ch1.S.html

For a Seybold seminar on the future of publishing:

http://seminars.seyboldreports.com/1999_boston/conferences/13/13_transcript.html

____________________________________________________

TELL A FRIEND ABOUT EDITORIUM UPDATE

Thanks for subscribing to Editorium Update. We publish the newsletter free of charge, asking only that you forward it to friends and associates who might find it useful. (Please get their approval before you send it.) We'd also appreciate your suggestions for newsletter articles and improvements. Please email your comments here: mailto:edi-@editorium.com.

You can read past issues of the newsletter here: http://www.editorium.com/euindex.htm _____________________________________________________

THE FINE PRINT

Editorium Update (ISSN 1534-1283) is published by:

The EDITORIUM Microsoft Word Add-Ins for Publishing Professionals http://www.editorium.com

Copyright © 2003 by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

You may manually forward Editorium Update in its entirety to others (but not charge for it) and print or store it for your own use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is strictly prohibited. If you're interested in reprinting one of our articles, please send an email message here: mailto:repr-@editorium.com

Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user assumes the entire risk as to the accuracy and use of this document.

The Editorium is not affiliated with Microsoft Corporation. _____________________________________________________

HOW TO SUBSCRIBE OR UNSUBSCRIBE

If you haven't subscribed to Editorium Update but would like to, send a blank email message here: mailto:editorium--@topica.com.

To unsubscribe, send a blank email message here: mailto:editorium-u-@topica.com.

We do not sell, rent, or give our subscriber list to anyone.

 

Hyphenation Exception Dictionary

A few weeks ago, I mentioned that I'd been working on a long, complex book that had to be typeset in Microsoft Word. I learned a lot from the experience, and I'll be passing on some of that hard-won knowledge in future issues. As I worked on the book, one problem quickly became apparent: Microsoft Word has no hyphenation exception dictionary. A hyphenation exception dictionary is a list of words that specifies how certain words should (or should not) be broken at the end of a line. For example, a really tiny hyphenation exception dictionary might include the following entries as words that shouldn't be broken at all:

people

little

create

It might also include the following words, with optional hyphens indicating breaking points:

con-vert-ible (not con-ver-ti-ble)

tan-gible (not tang-i-ble)

tri-angle (not trian-gle)

Microsoft Word will break all of those words badly.

Dedicated typesetting programs such as QuarkXPress will automatically check a hyphenation exception dictionary (if you've provided one) and break words accordingly. Microsoft Word won't, but there is a way around the problem. First, compile your hyphenation exception list. Then record a macro that finds each word on your list and replaces it with the same word including optional hyphens and zero-width nonbreaking spaces as needed. You can learn more about zero-width nonbreaking spaces here:

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

And you can learn more about optional hyphens here:

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

Using the words above, our list might look like this (I'm using a hyphen [-] to represent optional hyphens and a tilde [~] to represent a zero-width nonbreaking space):

peo~ple

lit~tle

cre~ate

con-vert-ible

tan-gible

tri-angle

So you'd find "people" and replace it with "peo~ple," "triangle" and replace it with "tri-angle," and so on. Then, when Word does its automatic hyphenation, the words will break in the way you've specified rather than in the (incorrect) way Microsoft Word uses by default (using, in my case, American English rules). It's not that Word does a bad job of hyphenation, mind you. It's actually pretty good. But even the best hyphenation algorithms need a little help.

A more elegant (and probably more reliable) way of preventing breaks is to mark the words in question so that they are not "proofed"--that is, so that they won't be checked for spelling, grammar, or (most important) hyphenation. To do that, select a word, click Tools > Language > Set Language, and put a check in the checkbox labeled "Do not check spelling or grammar." This has the advantage of not introducing an invisible character into the word, which will keep an unwanted space from showing up later if you use the document to create a Web page, an ebook, or whatever.

A better way than recording all of these words in a macro is to use our RazzmaTag program, which will run your hyphenation exception list on a whole folder full of documents at one time. It will also let you edit and add to your list as needed. I've prepared preliminary versions of such lists that you can download and play with. The one using the zero-width nonbreaking space is here (this list will work with MegaReplacer as well as RazzmaTag):

http://www.editorium.com/ftp/nonbreakinglist.zip

And the one marking the words so they won't be proofed is here (RazzmaTag only):

http://www.editorium.com/ftp/noproofinglist.zip

But what I'd really like is for you to send me any hyphenation exception lists you already have (maybe check with your typesetter). Then I'll merge them and include the comprehensive list in next week's newsletter! Come on--what do you say? Please email your lists to mailto:editor [at symbol] editorium.com.

You can learn more about RazzmaTag here:

http://www.editorium.com/razzmatag.htm

And you can learn more about MegaReplacer here:

http://www.editorium.com/14843.htm

_________________________________________

READERS WRITE

After reading the article on finding and replacing weird WordPerfect characters wrote:

I work with Word 98 on a Mac and occasionally tangle with WP documents. A few days ago, a writer sent a WP file to me. I opened it in Word, as Text, and found lots of gibberish--my favorite character being the letter Y with two dots over it: . This character was interspersed between *every* legitimate letter and space. (I would see, basically, this: letter and space.) Copying it and using Find and Replace was fruitless. Word refused to cooperate.

I decided to try opening the file with Word, but not as ASCII Text. Opening it as RTF gave me the same results, as did opening it as a Word Document. But I then tried an option called "Recover Text from Any File," and the document opened with text that was absolutely clean. I mean *really* clean.

The only caveat I can think of is that there was no special formatting in this file. I'm responsible for formatting the document and sending it on to my editor.

Yateendra Joshi (yateen@teri.res.in) wrote:

Thank you for the interesting and useful article on ellipses in the 16 January 2001 issue of Editorium Update.

Most often, ellipses stand for omitted matter, and the dots will represent it even better if they do not sit on the line but are raised a bit, say to the centre of the letter x (lowercase eks). The extent to which the dots should be raised will depend on the font (raising by 2 points works best with 11-point Georgia). The sequence is therefore to type the dots as you explain, then select them, and raise them by Format > Font > Character Spacing > Position > Raised By followed by typing in the appropriate value. It helps to see the text enlarged by 500%.

Thanks to Fran and Yateendra for the great tips!

Break That Word Here!

Last week's newsletter explained how to use a zero-width nonbreaking space to keep a word from breaking at the end of a line when hyphenation is turned on (Tools > Language > Hyphenation > Automatically hyphenate document). Fine as far as it goes. But what can you do to break a word at a place other than one Microsoft Word insists on using? For example, Word will happily break "convertible" as "converti-ble." Ugh. (See your favorite style manual for more information about how to break words properly; I prefer The Chicago Manual of Style.)

The solution is to insert an optional hyphen at any acceptable breaking points. In "convertible," for example, you could insert optional hyphens as follows: con-vert-ible. The optional hyphens will override word's automatic hyphenation and break the word at one of the points you've specified.

To get an optional hyphen, click Insert > Symbol > Special Characters > Optional hyphen. Or, easier yet, press CTRL + - (on a Macintosh press COMMAND + -).

In our shop, proofreaders check galleys for bad breaks, which are then corrected manually by our typesetters, who insert optional hyphens as needed (although usually in QuarkXPress rather than Word). Wouldn't it be nice if there was a way to insert optional hyphens automatically? As it turns out, there is--even in Microsoft Word.

Stay tuned; next week I'll tell you all about it.

You can learn more about The Chicago Manual of Style here:

http://www.press.uchicago.edu/cgi-bin/hfs.cgi/00/12245.ctl

And you can see the FAQ here:

http://www.press.uchicago.edu/Misc/Chicago/cmosfaq/cmosfaq.html

_________________________________________

READERS WRITE

After reading last week's article about how to use a zero-width nonbreaking space to keep a word from breaking, Patsy Price sent a tip about an elegant alternative:

I too have been very frustrated when specific words insisted on breaking in Word 98 (Mac) whether I wanted them to or not. I tried everything I could think of, including inserting a nonbreaking hyphen before the word, but nothing worked. Then somebody on one of the lists I belong to made a suggestion that has worked for me so far: select the word and change the language to No Proofing [Tools > Language > Do not check spelling or grammar]. Even when the file is opened in Word 2000 PC the word doesn't hyphenate.

Patsy made the effort to track down the person who originally made the suggestion, H?l?ne Dion on the McEdit list. So thanks to H?l?ne for the tip and to Patsy for passing it on.

Bill Rubidge (wbr@aya.yale.edu) sent the following tip on how to make a zero-width nonbreaking hyphen in Word 97, along with a brilliant wildcard find-and-replace routine to keep words together at the end of a paragraph.

Interesting zero-width action. In my case I wanted to break long URLs in a narrow text column. Unfortunately, I am still using Word 97, so I had to resort to a conditional hyphen solution, but I set the hyphen size to 1 point and colored it white to hide it.

In any case, my experience on that issue and your description of the one below made me think you could take your "Don't break that word" solution a step further. I never use hyphenation, so I don't have your issue, but I dislike short words ending up all by their lonesome as the final line of a paragraph. My solution is:

Search for:

([A-Za-z0-9,.$?;:'"")!*]{1,8}) ([A-Za-z0-9,.$?;:'"")!*]{1,8})[^013]

Replace with:

1^s2

This forces the last two words (up to eight characters long) to be on the last line together.

Your hyphenation problem seems similar, but I shudder at the thought of inserting the Unicode characters manually. Would it do the job for you to search for the end of a paragraph and then insert the nonbreaking zero-width space character between EVERY letter of the last word? This way, you could run this macro automatically for the whole document.

By the way, I found I had to do an additional undo search to take out these things where I knew that the item was part of a small column. For example, if the found item was in a table, I would undo the nonbreaking material, as the table columns might be too narrow for this to be appropriate.

Thanks to Bill for the great tips.

_________________________________________

RESOURCES

Possibly the ultimate treatise on the subject, the fascinating book Hyphenation, by Ronald McIntosh and David Fawthrop, is available free online:

http://www.hyphenologist.co.uk/book/BOOK-ED3.HTM