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

Don't Break That Word!

I've recently been editing a long, scholarly tome that, for reasons I'll discuss in a future newsletter, my co-workers and I decided to typeset in Microsoft Word, following the techniques explained here:

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

Our intrepid typesetter has been fairly content except for one thing: there seems to be no way to keep a word from breaking at the end of a line. Microsoft Word happily breaks "Je-sus" and "Bud-dha," for example, which we'd like to avoid. We could force a word down with a soft return, but that doesn't seem like a very elegant solution. Clever idea: how about putting an optional hyphen (CTRL + -) at the *beginning* of the word? That works, but it also *displays* a hyphen at the beginning of the word, which certainly won't do. Can the optional hyphen go at the end of the word? No, that doesn't work at all. So where might we find an answer?

Well, Unicode fonts include all kinds of interesting things. Would they, by chance, include a zero-width nonbreaking space? If we had one of those, we could insert it at the spot where we didn't want a break to occur. I went to Alan Wood's spectacular Unicode Resources site and searched for "zero-width nonbreaking space":

http://www.alanwood.net/unicode/search.html

There it was, not under general punctuation but as the last entry under Arabic Presentation Forms, of all things:

http://www.alanwood.net/unicode/arabic_presentation_forms_b.html

The Web site told me the decimal number (65279) and hex number (FEFF) of the character, so I fired up Word 2002 (XP) and entered the character by typing the hex number followed by ALT + x. With nonprinting characters showing, I could see the little beauty--it looked like a gray box inside a gray box. When nonprinting characters *weren't* showing, the character was invisible, since it had no width. And sure enough, when I put the character into a word and then pushed that word to the end of the line, the word refused to break. Success!

I sent a sample to Word guru Steve Hudson, who tested the idea in various ways and pronounced it good. Thanks, Steve! So now I share this little marvel with you. If you'd like to see the character in action (and get a sample of the character that you can copy and use in your own documents), you can download the following document to play around with:

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

After you download, unzip, and open the document, notice the automatically hyphenated "excellent" on the first line. Now add a character somewhere in the middle of the *second* line--enough to make the second "excellent" break. But it won't!

Incidentally, the character works in Word 2000 and later versions as long as you have Unicode fonts installed on your computer. You can learn more here:

http://www.alanwood.net/unicode/fonts.html

Please note that using this character within a word will mess up spell-checking for that word, so you might want to check spelling *before* inserting the character hither and yon. If you need to get rid of the characters, display nonprinting characters; then search for ^u65279 and replace with nothing.

_________________________________________

READERS WRITE

After reading last week's article on finding and replacing weird WordPerfect characters, Jane Lyle (jlyle@indiana.edu), managing editor at Indiana University Press, sent the following macro. Thanks, Jane! The macro does its work by searching for characters formatted in the WP TypographicSymbols font, and it includes some characters that last week's macro overlooked. If you don't know how to use such macros, you can find out here.

'MACRO BEGINS HERE

' WPTyp Macro

' Macro recorded 10/25/2001 by Jane Lyle

'
Selection.Find.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = ""

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "A"

.Replacement.Text = """"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "@"

.Replacement.Text = """"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = ">"

.Replacement.Text = "'"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "="

.Replacement.Text = "'"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "B"

.Replacement.Text = "^="

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "C"

.Replacement.Text = "^+"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "?"

.Replacement.Text = """"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Replacement.Font.Name = "Times New Roman"

.Font.Name = "WP TypographicSymbols"

.Text = "Y"

.Replacement.Text = ". . ."

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

'MACRO ENDS HERE

_________________________________________

RESOURCES

You can find lots of interesting spaces, hyphens, and other Unicode characters here:

http://www.alanwood.net/unicode/general_punctuation.html

Wordperfect Weirdness

I work with lots of authors who use WordPerfect. Sometimes they pass their documents on to colleagues who use Microsoft Word. That wouldn't be a problem if the authors would first save their documents in Word format. But they don't, and their colleagues work on the documents in Word, pass them around to others, and then give them back to the authors, who send them to me.

When I open these documents they look okay--except that some of the characters look kind of funny. The quotation marks and apostrophes are a little crooked, and the em dashes are thick and bold. What's going on here?

What's going on is that these aren't regular ANSI characters. You can prove this by selecting one and then pressing CTRL + SPACEBAR to remove any directly applied formatting. When you do, the character will turn into some other character. With this particular kind of weirdness, an opening quotation mark (for example) will become a capital A. You could Find and Replace these with real quotation marks, but your document may have hundreds--even thousands--of *real* capital A's that you want to preserve.

Here's a list of the pseudo-characters (the ones I've identified; there could be more) and their corresponding true identities:

CHARACTER DISGUISED AS TRUE IDENTITY (sort of)

Em dash C

En dash B

Opening quotation mark A

Closing quotation mark @

Opening single quotation mark >

Closing single quotation mark

(apostrophe) =

Another way to prove something weird is happening is to put your cursor in front of one of these characters and then run the macro you'll find here:

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

The macro will tell you that the ANSI number is 40--which is really the number for an opening parenthesis. That will be true whether you're checking a pseudo-quotation mark, em dash, en dash, whatever. So you can't Find and Replace them by using character number 40, either, since your document may contain legitimate parentheses.

What's needed is a way to Find and Replace a character that is an A (or whatever) *and* has the ANSI number 40. At the end of this article is a macro (one for Word 97 and above; one for Word 6 and 95) that will do just that, for all the weird characters in question.

Now, if you run into this WordPerfect weirdness, you'll have a way to fix it. If you know about other characters that act the same way, please let me know and I'll include them in a future newsletter with a revised macro.

If you remove directly applied formatting and the character (such as an em dash) *doesn't* change to something else (such as a C) but instead to a less-bold version of the same thing (which can happen), then the macro won't fix it. It if you know what's going on with *these* weird characters and how to fix them, please let me know and I'll share your solution in the newsletter.

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

'MACRO FOR WORD 97 AND ABOVE STARTS HERE

Dim a

Dim i

Dim FalseChar$

Dim TrueChar$

Dim ThisChar

WordBasic.EditFindClearFormatting

WordBasic.EditReplaceClearFormatting

WordBasic.StartOfDocument

'Check for platform

a = InStr(WordBasic.[AppInfo$](1), "Macintosh")

For i = 1 To 6

'Set find and replace variables

Select Case i

Case 1

FalseChar$ = "C"

If a Then

TrueChar$ = Chr(209)

Else

TrueChar$ = Chr(151)

End If

Case 2

FalseChar$ = "B"

If a Then

TrueChar$ = Chr(208)

Else

TrueChar$ = Chr(150)

End If

Case 3

FalseChar$ = "A"

If a Then

TrueChar$ = Chr(210)

Else

TrueChar$ = Chr(147)

End If

Case 4

FalseChar$ = "@"

If a Then

TrueChar$ = Chr(211)

Else

TrueChar$ = Chr(148)

End If

Case 5

FalseChar$ = ">"

If a Then

TrueChar$ = Chr(212)

Else

TrueChar$ = Chr(145)

End If

Case 6

FalseChar$ = "="

If a Then

TrueChar$ = Chr(213)

Else

TrueChar$ = Chr(146)

End If

Case Else

End Select

'Find and replace

WordBasic.EditFind Find:=FalseChar$, MatchCase:=1, PatternMatch:=0

While WordBasic.EditFindFound()

ThisChar = Asc(WordBasic.[Selection$]())

If ThisChar = 40 Then

WordBasic.WW6_EditClear

WordBasic.Insert TrueChar$

End If

WordBasic.EditFind

Wend

Next i

'MACRO ENDS HERE

'MACRO FOR WORD 6 and 95 STARTS HERE

EditFindClearFormatting

EditReplaceClearFormatting

StartOfDocument

'Check for platform

a = InStr(AppInfo$(1), "Macintosh")

For i = 1 To 6

'Set find and replace variables

Select Case i

Case 1

FalseChar$ = "C"

If a Then

TrueChar$ = Chr$(209)

Else

TrueChar$ = Chr$(151)

End If

Case 2

FalseChar$ = "B"

If a Then

TrueChar$ = Chr$(208)

Else

TrueChar$ = Chr$(150)

End If

Case 3

FalseChar$ = "A"

If a Then

TrueChar$ = Chr$(210)

Else

TrueChar$ = Chr$(147)

End If

Case 4

FalseChar$ = "@"

If a Then

TrueChar$ = Chr$(211)

Else

TrueChar$ = Chr$(148)

End If

Case 5

FalseChar$ = ">"

If a Then

TrueChar$ = Chr$(212)

Else

TrueChar$ = Chr$(145)

End If

Case 6

FalseChar$ = "="

If a Then

TrueChar$ = Chr$(213)

Else

TrueChar$ = Chr$(146)

End If

Case Else

End Select

'Find and replace

EditFind .Find = FalseChar$, .MatchCase = 1, .PatternMatch = 0

While EditFindFound()

ThisChar = Asc(Selection$())

If ThisChar = 40 Then

WW6_EditClear

Insert TrueChar$

End If

EditFind

Wend

Next i

'MACRO ENDS HERE

_________________________________________

READERS WRITE

Donna Payne wrote:

In response to readers write about Track Changes in Word 2002:

Although Microsoft has removed the option for how deleted text should appear in this version due to markup balloons, we have a free pdf file at the following location that explains how to get around this:

http://www.payneconsulting.com/public/tips/TipDetail.asp?nTipID=82.

Donna Payne

President

Payne Consulting Group, Inc.

www.payneconsulting.com

___________________

Johanna Murphy wrote:

In answer to Mary Eberle's comments regarding AutoCorrect in you previous newsletter, I would like to give you my comments on this subject. I also have been using AutoCorrect heavily in Word 97, and I copied my normal over. The problem I have is just the opposite. The formatted entries freeze up the program, but the unformatted all work. Especially the entries I have for inserting fields. For instance, I create a date by using the field Month Date and Year. I then copy it into the AutoCorrect box and tell it to be formatted, but it will turn it into unformatted or freeze up the program. I really hate that! Any suggestions would be appreciated.

While I've got your attention, I am also hoping you or your readers could help me with a problem in Word XP. I work for a law firm and when we had Word 97, I had created the firm's letterhead templates, pleading templates, etc. I inserted comments into the templates for the other users' convenience. When the templates were transferred to Word XP, the comments showed up as a thin vertical line on the screen, and the lines ALSO PRINTED! Every time I open a template it is set to "Final Markup." Since then, I have learned to use the Reviewing Toolbar to set the document to "Final Document." This procedure is very tiresome to always have to remember to switch to Final Document. Staff and attorneys call me all the time to ask why these vertical lines show up when they print something. I have deleted the comments out of the templates, but the lines still show up unexpectedly on the printed documents even though they don't show on the screen anymore. Is there help for this? Thanks.

Thanks to Donna for the additional information and to Johanna for her questions.

_________________________________________

RESOURCES

If you're having problems importing documents from other word processing programs into Microsoft Word, some of the document converters from Microsoft may help:

http://office.microsoft.com/downloads/default.aspx?Product=Word&Version=95|97|98|2000|2002&Type=Converter|Viewer

Button Bonanza

Stars, pencils, light bulbs, puppy dogs, faces, diamonds, and hearts. What am I talking about? Toolbar buttons! Lots and lots of toolbar buttons!

If you like assigning macros to toolbar buttons, you're probably tired of the paltry 42 images you can use on those buttons by default. But fear not! Word has hundreds of images available. You just have to know how to get to them. The only way I know is with a macro, and I'm perfectly happy to share it with you:


'MACRO FOR WORD 97 AND ABOVE STARTS HERE
Sub MAKEBUTTONS()
HowManyToolBars = 10
HowManyButtons = 150
first = 1
last = HowManyButtons
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
TbarName$ = "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10))
WordBasic.NewToolbar Name:=TbarName$, Context:=0
For button = first To last
WordBasic.AddButton TbarName$, 1, 1, "Bold", button, 0, ""
Next button
first = first + HowManyButtons
last = last + HowManyButtons
WordBasic.SizeToolbar TbarName$, 600
WordBasic.MoveToolbar TbarName$, 0, toolbar, (toolbar * 2) + 100
Next toolbar
GoTo Endmacro
Warning:
WordBasic.MsgBox "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)) + " already exists.", "Delete Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

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

After you run it, you'll have 10 new toolbars, named Buttonbar 1, Buttonbar 2, and so on. Each toolbar will have 150 buttons. For the sake of programming simplicity, each button does the same thing: turn on bold formatting. But you can see a button's original function by resting your mouse pointer over it and waiting a few seconds for its tooltip to appear. You can also copy the images from any of the buttons to paste on any other buttons you want. For example, if you want to assign macros to custom toolbar buttons, you now have lots of button images to choose from. You can learn more about assigning macros to toolbar buttons here:

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

If you decide you no longer need the toolbars and their many buttons, you can delete them by running this macro:


'MACRO FOR WORD 97 AND ABOVE STARTS HERE
Sub DELETEBUTTONS()
HowManyToolBars = 10
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
WordBasic.ViewToolbars toolbar:="Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)), Delete:=1
Next toolbar
GoTo Endmacro
Warning:
WordBasic.MsgBox "The toolbar does not exist.", "No Such Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

If you really want to go crazy, you can step up the "10" in this line to create more than 10 toolbars:

HowManyToolbars = 10

And you can step up the "150" in this line to create more than 150 buttons on each toolbar:

HowManyButtons = 150

If you want to play around with this, please be judicious. The higher you set those numbers, the longer it will take to create the toolbars and buttons, and the more unwieldy they will become. I think 150 is pretty manageable for the number of buttons on a toolbar. You can set this to, say, 500, but that makes a *big* toolbar. And how many toolbars do you really need? The highest I've gone is 30, but I think 10 is plenty. It would be interesting to know how many images are actually available. After a while, quite a few of the images will be blank, and many of them will be duplicates.

WARNING: Be sure to adjust the macro that *deletes* buttons to correspond with the macro that *makes* buttons. To be more specific, the line "HowManyToolbars" should be set to the same number in both macros. If you ignore this, you could end up deleting all those toolbars by hand (under View > Toolbars).

Here are the corresponding macros for Word 6 and 95, which have only 366 images altogether, so don't try to make the macro go any higher. If you do, you'll just get an error message. The name of the toolbar here is "Buttons."


'MACRO TO CREATE TOOLBAR IN WORD 6/95 BEGINS HERE

Sub MAIN On Error Goto Warning NewToolbar "Buttons" AddButton "Buttons", 1, 1, "Bold", 0 For button = 1 To 366 AddButton "Buttons", button, 1, "Bold", button Next button SizeToolbar "Buttons", 600 Goto Endmacro Warning: MsgBox "The toolbar already exists.", "Delete Toolbar" Endmacro: End Sub 'MACRO ENDS HERE


'MACRO TO DELETE TOOLBAR IN WORD 6/95 BEGINS HERE
Sub MAIN
On Error Goto Warning
ViewToolbars .Toolbar = "Buttons", .Delete
Goto Endmacro
Warning:
MsgBox "The toolbar does not exist.", "No Such Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

Thanks to Frazer Wright for suggesting this topic.

_________________________________________

READERS WRITE

Responding to last week's article on setting Word 2002's tracking format, Keith Soltys wrote:

I was interested to note your macro for setting Word 2002 to mark deleted text as strikethrough. In versions of Word prior to 2002, I've usually set deleted text to be hidden. I was surprised to see that Word 2002 didn't allow you to change the option for this; I guess they really want you to use the balloons, a "feature" that I detest. (They also broke comments; there's a market for an addon to make Word 2002 comments work the same way that Word 2000 did).

However, I did run into a really interesting bug that you might not be aware of. If you are using Word 2000 and have your revision tracking options set so that revision tracking is on and deleted text is shown as hidden, this setting gets carried forward into your Word 2002 document. You can't change it through the interface, only through VBA.

In this case, and if you are not using balloons, you may run into pagination issues. What happens is that in print layout view, Word may insert spurious blank pages when it finds deleted text. Pagination will be OK in normal view, but in print layout you will get any number of blank pages added into your file. It gets even more interesting--if you go to print preview, your file may balloon in size to several thousand pages.

The conditions for this to happen are quite specific. You must have revision tracking set so that deleted text is marked as hidden and revision tracking must be set to Final Showing Markup, and you must be in Print Layout view and not using balloons.

The fix is to use VBA to change how Word shows deleted text from hidden to strikethrough. You can also accept the changes in the file. Or set revision tracking to Final, or use balloons.

I encountered this bug not long after "upgrading" to Word 2002. I posted a message about the problem to the word-pc list and was contacted by someone from Microsoft, who eventually confirmed that it was indeed a bug.

_______________

Adding to Rohn Solecki's technique (explained in last week's newsletter) of using formatting to emulate text on a green-screen computer monitor, Stephen Riley wrote:

I used to do something very similar "back in the day". Another great advantage is being able to cheat and edit the data you have captured.

It's sometimes a heck of a lot easier to do this than to setup meaningful data in whatever application you are documenting.

As an extra snippet this was when I was documenting green screen Unix apps. Screen capture was via a terminal emulator (Reflection?) running on a PC.

For report files, print to .txt file and ftp from server to PC. Similar Style definition tweaked for 132 chars and using a landscape page.

_______________

Mary Eberle sent in a question that some astute reader may be able to answer:

I have been using AutoCorrect in Word 97 a lot lately. I have two approaches to the item that replaces what I type: (1) unformatted and (2) formatted (i.e., including a word or phrase in italics, bold, or something like that).

I just bought a laptop and copied my Normal.dot file onto the laptop. The "formatted" items in the AutoCorrect list copied, but the "unformatted" items did not. Do you know how to make the "unformatted" ones copy as well?

Mary also provided the following tip:

The reason I've been using AutoCorrect so much is that I've found a way to simplify my editing considerably. For example, if the author has used the verb "is" but the verb should be "are," I have an AutoCorrect entry that changes "isz_" (where the _ represents a space--the trigger for AutoCorrect to make the change) to "are"; I place the cursor right after the "is" and then access the AutoCorrect feature with a function key that types "z space backspace" and the "is" toggles to "are." By using the same function key I can toggle "are" back to "is" ("arez" becomes "is"). I have set up numerous such pairs in my original AutoCorrect file. I used "z" because in English it doesn't form many words at the end of a word; if one just uses a space, AutoCorrect jumps in to "help" when it is not wanted.

You may wonder how I'm using a function key to accomplish the "z" thing. Well, I was actually using a key on my programmable X-keys keyboard.

One reason the z_space approach and the X-keys are helping me speed up my editing is that I don't have to take my right hand off the mouse, so I can quickly move to the next thing that needs to be fixed.

Further information: Just typing "z" and then "space" will invoke the "isz to are" or "arez to is" toggle. No backspace or macro is needed. I've been using the programmable X-keys for so long now that I'm not used to just using the regular keyboard. Anyway, I hope that this toggle idea is useful to you.

_______________

Susan Bullowa asked the following questions. Any takers?

1. On rare occasions that I cannot seem to reproduce on my own, a screen tip appears when my cursor hovers over a paragraph (not the same as pressing SHIFT+ F1). The yellow box summarizes all of the formatting information for that paragraph. I love it but cannot seem to get it to appear consistently. Would anyone know what it is?

2. Your recent newsletters on styles that you and other book editors use have been very helpful. I had evolved to creating a template for the freelance work I do for a publisher. The compositor there uses Quark on a Mac. I've tried to make it easy for him to convert my PC Word files (RTF naturally) into Quark. I'd like to make a template for the authors who often do not know how to use styles. Has anyone created a basic template for the poor dears who reformat all of their Normal-style paragraphs manually? A template that also guides them?

Thanks to all for their comments and tips.

_________________________________________

RESOURCES

Some people enjoy creating and making available even more toolbar buttons. Here's one commercial source:

http://www.amfsoftware.com/word/icons.html

And a free one:

http://www.softpile.com/Business/Miscellaneous/Review_01543_index.html

Revision-Tracking Format in Word 2002

Before Word 2002, it was possible to set revision-tracking colors and formatting separately for inserted and deleted text. The procedure was simple:

1. Click Tools / Track Changes / Highlight Changes / Options.

2. Select "Mark" (bold, italic, underline, or double underline) for "Inserted text."

3. Select "Color" (various) for "Inserted text."

4. Select "Mark" (bold, italic, underline, or double underline) for "Deleted text."

5. Select "Color" (various) for "Deleted text."

6. Click the "OK" button.

In Word 2002, however, this feature works only for "Inserted Text." "Deleted text" automatically follows suit, and there seems to be no way to set the two independently. To make matters worse, Strikethrough is no longer among the listed marking options. How annoying! Fortunately, there's a hidden way to overcome these limitations. I've exploited it in the following macro, which you can easily modify to meet your own needs:


Sub SetTrackingFormat()
With Options
.InsertedTextMark = wdInsertedTextMarkUnderline
.InsertedTextColor = wdBlue
.DeletedTextMark = wdDeletedTextMarkStrikeThrough
.DeletedTextColor = wdRed
End With
End Sub

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

The macro is currently set to mark insertions as blue text with underline, and to mark deletions as red text with strikethrough. To change this, replace the "Underline" on the end of "wdInsertedTextMarkUnderline" or the "StrikeThrough" on the end of "wdDeletedTextMarkStrikeThrough" with any of the following:

Bold

ColorOnly

DoubleUnderline

Italic

None

StrikeThrough

Underline

Then replace "wdBlue" or "wdRed" with any of the following:

wdBlack

wdBlue

wdBrightGreen

wdByAuthor

wdDarkBlue

wdDarkRed

wdDarkYellow

wdGray25

wdGray50

wdGreen

wdNoHighlight

wdPink

wdRed

wdTeal

wdTurquoise

wdViolet

wdWhite

wdYellow

Then run the macro (Tools / Macro / Macros). Hah, hah! Once again Microsoft Word must bend to your will!

_________________________________________

READERS WRITE

Readers have sent so many great tips and comments that it's taking a while to go through them all. They'll be appearing in the newsletter over the next few weeks. Today's issue makes a good start, however. Many thanks to Bill Rubidge, Rohn Solecki, and Rebecca Evans for their terrific comments and tips.

Referring to the December 18, 2002, issue of Editorium Update, which featured styles and style lists from readers, Bill Rubidge (wbr@aya.yale.edu) wrote:

Eric Fletcher explains that he uses an "Editorial Note" style. We use something similar, but the style is called "Open Issue". (Actually, the name has a prefix, so that all the styles we use are sorted together in the list and distinguishable from styles that may come from other templates or users). The style highlights items with color, as Eric's does, but we do one thing more.

At the end of our documents, we insert a page break and then type a title "Open Issues". Below that, we generate a TOC based only the Open Issue style (not any headings--TOC field {TOC t "wbrOpenIssue,1"}). This gives us a complete list of these open issues for the entire document, to ensure that none are overlooked.

By the way, we also insert these Open Issue paragraphs (which are sometimes just queries) ABOVE the item in question, and the Open Issue style has the paragraph set to "keep with next". This helps make the page number refs in the Open Issue TOC more accurate.

If you really want to get complicated, on multi-file projects (we deal with about 40 files per book), it may be easier to just extract the open issues from the file and put them into another document. For now, I just do this using the open issue TOC at the end of each file, but have a macro that copies it (fields unlinked) to the clipboard and then opens up our Open Issue file (in Excel, for easier sorting). Based on posts in the Word PC listserve, I think involving Maggie Seneca, I think you could also harvest all the Open Issue items in the file and automatically write them to another file (rather than the manual paste we're using).

You might refer to the macro that Bryan and Pieter helped Eve Golden with, back in the Daily Word Tips list. I think the last posts about it were from November 20. That macro searches for text highlighted in a certain way, and copies all that text and appends it to a separate file.

_______________

Rohn Solecki wrote:

I also have a favorite style you might want to pass on. Although it may not be useful to the publishing industry, it is handy for internal documentation in companies that still use "green screen" computer terminals. Green screen terminals are the old style fixed pitch font, by default 24 line by 80 character displays (but optionally up to 27 lines by 132 characters).

Rather than doing a graphic screen capture I do a Edit / Select All, Edit / Copy to capture the text, paste to Word, then apply my "Screen Print" paragraph style to reasonably simulate the appearance of text on the computer terminal. This style has 3 main advantages over pasting a graphic screen capture:

* It uses orders of magnitude less space, which is important if you have lots of screens to capture.

* It is editable, so if something on screen changes you don't have redo the capture.

* Since it is editable, it is easy to apply character formatting like highlighter or font colors to highlight specific sections (without having to use a separate graphics program).

Details of Screen Print Paragraph Style:

* Paragraph Formatting - Flush Left, Keep with Next, Keep lines together, Border: box (single line), Shading: 5%, Indent: Hanging 0.25 Right 0", Widow and Orphan Control. Font Formatting - Courier, 10 pt, Condensed 0.5 pt.

Reasons for choices:

* The Box Border and 5% Shading simulate the look of the screen.

* Keep Lines together and Keep with next ensure that the whole screen capture stays on same page.

* Hanging indent is optional if a line wraps for some reason, for example, capturing from a 132-character display.

* Courier is fixed pitch so characters line up as they did on screen.

* 10 pt Condensed 0.5pt so that an 80-character line will fit on a page with reasonable margins (less than the default 1.5" both sides) without wrapping.

_______________

Rebecca Evans (evansreb@earthlink.net) wrote:

I have been designing and typesetting books for a living since 1976. Being able to use style tags in today's programs is certainly a blessing compared to keeping a spec sheet beside you so you can hand key specs as you re-type a book from a typemarked manuscript.

My comment on the style naming issue is that I have found I do not need list tags that add space after the list (NL End), just the tag to begin the list and for the interior paragraphs. All I need after lists, boxes, and the like, are two Body Text tags with added space above them, one with a paragraph indent and one without, because any paragraph style other than Body Text--heads, extracts, boxes, summaries, other lists--already includes space above.

Of course this assumes that spacing is consistent within a design so that you don't have +12' below a BL and +6' below an NL. And, I realize this may not be applicable to documents other than books. However, in my experience with textbooks, I have found those two extra Body Text styles to be all the "exit" styles I need.

On another note, I use two character style names because that lets me reduce the width of the style tag window (I use Ventura Publisher and keep the style list docked and open on screen), leaving more screen width to display page spreads. This is not an issue if you use a style drop down menu but I thought I'd throw in my two cents on that one too.

I responded, "Not being a Ventura user myself, I'd like to know why Ventura users want to tag Word files before bringing them into Ventura. Won't Ventura import RTF files? Any light you could shed on that subject for me?"

Rebecca replied:

Ventura does import RTF files--it will even File:Open RTF files and build copies of all the Styles as closely as possible to how they are in Word. Irrespective of that, you elucidated the reasons for using raw codes very well in your recent essay.

Most books are Styled erratically by the author and there is usually so much junk left in text files that it's easier to clean up the text if you can see the raw codes. Much of what I clean up is taken care of by EKTPlus but I still like to see exactly what I'm importing before I import it.

Also, an author's Styles, even if perfectly applied, never match the design of the typeset book. It is far easier for me to type codes than to drop down the Style list and click each one. Assign Styles to buttons takes a long time and would be almost as much work to use as dropping down the style list.

I use XyWrite for coding text files because I can drop in coding with short-cut keys, which are incredibly easy to assign in XyWrite: no menus, just select the text, press F2, press the key you want to use for that shortcut (any key), then press F3 to deselect the text. Then it's just ALT+"that key" to insert the text. You can keep reassigning new text to your shortcut keys as you work.

XyWrite also has macro-scripting capabilities that let me build S&R tables for almost anything. I keep the S&R table open in a separate window while I work so I can change/add entries in it as I go along.

Unfortunately, XyWrite is ASCII and everything else in the world (seemingly) is ANSI so I've recently been converting over to coding in Word. Assigning and using shortcut keys is more of a process in Word because alphanumeric keys are used for Word function shortcuts.

I should tell you that XyWrite is an older program used mostly by programming types now. XyWrite is DOS-based so I don't know if it will even run under Windows XP. It's an old friend for me but someone trying to learn it today probably wouldn't know what to do with the command line at the top of the screen (very useful if you know DOS commands) and would have to adjust to using function keys rather than the CTRL/ALT keys to execute commands.

There are folks out there who write scripts for converting Word coding to Ventura--Allan Shearer in Canada comes to mind--but your programs are so well executed and beautifully interfaced that it's worth paying for them even if the same functions are available free from other sources.

_________________________________________

RESOURCES

RMIT University has an excellent collection of links related to editing and publishing:

http://www.rmit.edu.au/links/publish.htm