Editing by Concordance, Part 2

Last week's newsletter explained some ways a concordance could be used in editing, with a promise that this week I'd show you a sneaky way to take that concept even further. So here goes.

There you are with a manuscript that needs editing, and lots of it. A cursory look reveals multiple inconsistencies and odd spellings, and you're going to have to fix them all. What to do? Try this:

1. Use our WordCounter program or the MakeConcordance macro in last week's newsletter (scroll down to the end of Readers Write) to create a concordance, or word list, of all the words in the document.

You can download WordCounter here:

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

And you can read last week's newsletter here:

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

This time around, you don't need to worry about word frequency (although you can if you find that helpful). Instead, just make a list that looks like this:

and

managment

manger

of

the

And so on.

You could go through the list and manually delete all the commonly used words (such as "and," "of," and "the"), leaving you with the words you actually need to think about, but that would take a long, long time. A better way would be to use our MegaReplacer program to remove the commonly used words:

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

And you could do that if you just had a list of commonly used words. You can download one here:

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

The list contains 2,256 entries (compiled from various sources) and is already set up for use in MegaReplacer. So use the list with MegaReplacer to delete all of the commonly used words from your word list, leaving you with just the real stuff.

Once you've got the real stuff (such as "manger" and "managment"), you'll find it much easier to go through the list and decide what needs to be changed. Please do so. As you find words like "managment" that need to be corrected, set *them* up for MegaReplacer as well:

managment|management

manger|manager

The bad goes on the left, the good on the right, with a pipe symbol in between. You may also want to add the good to your editorial style sheet, as explained in the newsletters for April 28 and May 5:

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

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

Aside from misspellings, you'll also find inconsistencies in spelling, style, and capitalization that need to be fixed. Set them up the way you want them to be:

realise|realize

When you come to words that are fine just as they are, add them to your editorial style sheet as needed and then delete them from the list,

When you're finished, you'll have a beautiful find-and-replace list that you can feed to MegaReplacer, which will go through your manuscript and automatically make all the changes you've specified. If this makes you nervous, you should know that you can have the program mark its revisions in case you later have any question about what was changed.

If you're looking for a way to speed up your work, you may find this technique useful. There's one way to find out. And you've got to admit that using a word list to modify a word list to modify a document is pretty sneaky.

_________________________________________

READERS WRITE

Teresa N. Barensfeld wrote:

Another good use for the concordance is for projects with vast reference lists. Sometimes the names are inconsistently spelled in the text or the ref list, but they're so close that it's easy to miss.

---------------------------------------------------

Dave Gayman wrote:

Meg asked:

"Now I'm wondering: I don't think a Word macro can open a window in another program and order a paste there. That would be very helpful."

Remembering that this was a stopper in a VBA project long ago--and I don't remember if it was because it could not be done, or simply that I could not master the commands to make it happen--I'd suggest MacroExpress (http://www.macros.com/index.htm), $50.

With MacroExpress, you simply record the key or mouse strokes (or both) to accomplish the task. In addition to recording the macro, users are also able to enter macros directly into an edit pane (much of which is done via select and paste) and they are able to edit the code that has been generated automatically. Before the recording begins, a sequence of dialogs lets you make choices, including whether you'll be capturing key strokes, mouse movement, or both; applicability--see next paragraph; hot keys; macro name, and so on.

Macros can be global (that is, work with all programs), program-specific, or window-specific. You can assign hot keys to the macro, as well as assign a password. In Meg's case, once Meg selects the target word, MacroExpress could copy the word, switch to (or launch, if it is not already open) the second window; if necessary position the cursor (for example, at the end); paste; then switch back to the Word window.

I've used MacroExpress to automate or semi-automate the process of eliminating duplicates in a long product order code list by cross-reffing against an Excel file; to set up glossary entries (including both making a new entry and applying of Word styles for formatting); and many small repetitive tasks.

Although I originally bought MacroExpress to create actions in Dragon NaturallySpeaking Preferred edition (a version level without macro capabilities), the order code duplicate finder gave me my $50 in value. It took a project that could easily have consumed three days and telescoped it into about an hour. Note that there is usually a variable amount of debugging to be done to make a macro more generic or to make it do everything you want it to do--the duplicate finder took about half an hour to set up and tweak, all told.

There's a support newsgroup where newbies are generally treated humanely (find it at http://www.pgmacros.com/newsgroup.htm). Users run the gamut from casual operators of the program (like me) to very serious macro wranglers with correspondingly complex automated tasks.

---------------------------------------------------

Richard H. Adin wrote:

I don't have a within Word answer for Meg, but I do have an answer that will work on a Windows PC: using MacroExpress (http://www.macroexpress.com).

I had three problems that needed solving and I couldn't figure out how to do it within Word:

(1) How to copy a phrase from my text document to a style sheet and, if the phrase had an acronym, how to enter it twice on the style sheet--once as, e.g., World Health Organization (WHO) and then as WHO (World Health Organization);

(2) I'm pretty sure that five chapters ago I had come across the acronym, e.g., WHO, and had spelled it out and added it to my style sheet. Now I've come across it again and it needs to be spelled out here, but I can't recall what it means. I wanted to quickly check the style sheet to see if it was spelled out, and if it was, then copy the spelled-out version and paste it in place in the text file; and

(3) In books that follow the APA reference style (or any similar style) in which the text reference entry appears as, e.g., Smith, Jones, Adams, and Burley (1998), how to (a) verify that the entry is in the references; (b) check for and mark subsequent entries so I don't have to reverify that it exists or is correct each time I come across the entry in the text; (c) mark the entry in the references so I know (i) which references have been cited in the text and which haven't and (ii) I know that I have already checked that the reference is properly styled; (d) if the subsequent text entries are Smith, Jones, Adams, and Burley (1998) when they should be Smith et al. (1998), I can correct the erroneous entries; and, finally, (e) when done, I am returned to where I started.

Although the macros I have written in MacroExpress can yet be improved upon (and I am constantly improving them), they do work well as is. Below are the steps I take to run a macro for each problem.

________________________

Problem 1: To add material to the style sheet:

1. Highlight the material to be added. If it is just a word or a phrase, highlight that; if it is a word/phrase with an acronym, highlight the spelled out word/phrase + the acronym, including the opening and closing parentheses.

2. Press F9 (this just happens to be the key to which I assigned the macro; MacroExpress lets you assign most any key combination).

3. In the dialog box that appears, enter only the place where you want to go. For example, in the WHO example, you want to go to the W section of the style sheet, so enter w and click OK.

4. You will be moved to the W section, and your cursor will blink where it is. BEFORE doing anything else, move the cursor to the beginning of the line where you want your selection to be entered. Do not add a return to make a line. If you already have entries, place the cursor at the beginning of the line that is to appear AFTER this entry is typed.

5. In the dialog box, make the appropriate choice. Choose Word for a word or phrase without an acronym; choose Word + Acronym for a word or phrase that has an acronym that needs to be entered; choose cancel to stop and return to the text file. Once you make your choice, the macro will paste your copied material at the insertion point on a new line. If you chose Word, you will then be returned to where you were in the text file. If you chose Word + Acronym, then

6. The macro will pause and tell you to move the cursor to the beginning of the line where you want the acronym to appear. Again, just move your cursor; do not add a line. When your cursor is in place, click Resume. The macro will paste the entry at the designated position, creating a new line, and will then move the acronym to the line beginning and put the spell out in the parentheses.

7. The macro will automatically return you to your place in the text file.

_________________________

Problem 2: Checking on an acronym

1. Highlight the acronym--just the acronym, not any spaces before or after.

2. Press F10 (again, this was my choice).

3. The macro will take you to the style sheet and will highlight the first instance of the acronym. There is a slight delay so that you can see what is being highlighted in the style sheet, after which a dialog box appears. If the highlighted acronym is the correct one, click Yes; if it isn't, click No. Click Cancel to terminate the macro and return to the text file.

4. If you choose Yes, the cursor will move to the beginning of the spell out and pause.

5. Now highlight the complete spell out, including the acronym and the closing parenthesis, but not the paragraph marker.

6. Click Resume. The macro will return to the highlighted acronym in the text file and replace it with the spell out and acronym in parentheses.

7. If you chose No rather than yes, the macro will search for the next instance of the acronym; if it finds another instance, you will have the same three choices. If it doesn't find it, Word will tell you that it has not been found and ask you whether you want to search from the beginning of the document. Choose yes or no depending on where the search started. If you choose no, then also choose cancel in the Macro Express dialog box. It will cancel the macro, close the Find and Replace box, and return you to where you were in the text file.

_________________________

Problem 3: Reference checker

1. Highlight the first author's surname only (e.g., in Smith and Jones (1995) or Smith, Jones, Adams, and Burley (1998), highlight only Smith).

2. Press F7 (my choice).

3. The macro will take you to the beginning of the reference list and then search for the first instance of the name you highlighted, highlighting the name in the reference (e.g., Smith). A dialog box will appear asking if this is the correct reference. If it is, click Yes. (If you choose no, the macro will find the next instance of Smith.)

4. In the next dialog box, choose whether this is a reference that has either 1 or 2 authors or 3+ authors.

(a) If 1-2 is chosen, the highlighted name in the reference list will be colored green and the macro will then return to the text file and search for the next instance of Smith, which it will highlight. A dialog box will appear and ask whether this is the correct reference. If yes, a marker will be inserted following the name; if no, the macro will search for the next instance of Smith, at which time the dialog box will appear. The process repeats until the macro reaches the end of the document and finds no more instances of Smith, at which time you cancel the macro and are returned to where you began.

(b) If 3+ is chosen, the highlighted name in the reference list will be colored green and the macro will then return to the text file and search for the next instance of Smith, which it will highlight. A dialog box will appear and ask whether this is the correct reference and if it needs to be modified. Your choices are different from those in (a). If the listing is Smith, Jones, Adams, and Burley and it should be Smith et al., you choose Yes (make et al. and mark). If it is already Smith et al. but is the correct reference, you choose No (is et al. but needs mark). And if it is not the correct Smith, you choose Find next so that the macro will not mark this reference and will search for the next instance of Smith. The process repeats until the macro reaches the end of the document and finds no more instances of Smith, at which time you cancel the macro and are returned to where you began.

(c) Because you may have already found this entry and colored it green in another chapter, you can also choose to just search the main text file. In this case, you are returned to the main text file without marking the reference file, and the process proceeds as above.

When you are done editing the document, you simply search for the marker and replace it with nothing.

_______________________

Because I work on a per-page or project fee basis, saving time is important. Do these macros save time? Absolutely. The steps look more cumbersome than they are--it's more difficult to explain the operation than to do it. Although the first two macros can be performed by using your mouse and keyboard to copy, switch between documents, paste, and switch documents again, my experience is that using the macros is much more efficient and faster. Even if I only save a few seconds each time, it adds up.

The third macro is a real timesaver because I accomplish several things simultaneously. (1) I verify that a reference is in the reference list and mark it (green highlight) so that when I get to the end of the project and now only have to check the reference list, I have already eliminated having to check most of the references--I only need to check those without the green highlight. (2) When I send the reference file to the author for review, I can tell the author that only those highlighted in green are cited in the text and ask what the author wants to do with the others. It becomes easy for the author to know which ones I mean. (3) By adding a marker to each occurrence of a reference in the main text, I speed things along because I know I have verified the reference already. It's a little slow in the beginning, but it speeds things as you move further along in the text. Imagine a 50-page chapter with scores of these references. How do you remember that Smith (1995) is OK but that Smith (1998) has not been verified?

MacroExpress has allowed me to make my keyboard more functional and to do things that were otherwise cumbersome. Just two quick examples of what I mean. (By the way, I primarily use Word, so all of the examples are of things that I do in Word. MacroExpress permits you to assign a macro to a specific application or to global, i.e., to every program.) Each of my clients has a different way to do things. Some want me to code with beginning and ending codes such as at the beginning of a bulleted list with at the very end of the list; some want me to apply a Word style to each paragraph; and some want specific codes used in specific series. MacroExpress lets me create different keyboards for different clients, and multiple keyboards for clients whose coding changes based on the series. Once I write a standard macro, for example, one that does the bullet list coding, I can import it into any number of keyboards and modify just the code, without modifying how it works, so that it inserts the codes the client wants.

In the case of the bulleted list, I press F6, and MacroExpress types and adds a bookmark. Then it pauses and tells me to move my cursor to the end of the bulleted list where I want the closing code placed. It doesn't matter whether the end is one line or 100 pages away; I move to it and click Resume, and MacroExpress types and then moves me back to the beginning of the list so I can edit.

I have one client who uses a standardized footnote system, e.g., every time a drug is named that is not FDA approved for the particular indication, the client wants a superscript 1 inserted in the text and then inserted as a new paragraph "1 This drug is not FDA approved for this indication." with the 1 superscripted and the Footnote style applied to the paragraph. With MacroExpress, I was able to write one macro that does it all. I place my cursor where I want the footnote reference inserted, press the assigned key combination, and in a split second it's done and I am returned to where I left off my editing. This ensures uniformity and that I don't forget to do something.

Many thanks to Teresa, Dave, and Richard for their excellent tips and comments.

_________________________________________

RESOURCES

If you're interested in MacroExpress, so wonderfully described in the Readers Write column above, you may also be interested in WinKeySim, which offers some of the same features. WinKeySim, however, is a freeware program for Windows 95 and later and Windows NT 4.0 and later. WinKeySim gives keyboard macro support for practically any Windows program that supports keyboard input. Generally speaking, if it can be done with the keyboard, it can be done with a WinKeySim macro.

http://mwganson.freeyellow.com/winkeysim/

Editing by Concordance

Our previous newsletter mentioned our WordCounter program, which can now tell you how many times each word has been used in a document--and I promised to show you how that might be useful for editing. The newsletter also featured a macro that will create a concordance, or list of all words used, from a Word document. Next week, I'll explain a very sneaky way to use that in editing, so stay tuned.

Let's say you've run WordCounter's concordance feature on a document, including word frequency, so you've now got a report in a table that looks like this:

1,639 and

1,453 the

1,330 of

Notice that the table is sorted by word frequency, with the most frequently used words at the top. That doesn't seem very useful; who cares how many times "and" and "of" appear? On the other hand, it may give you an idea of your author's general verbosity and other faults. Lots of prepositions? As you edit, watch for strings of prepositional phrases. Lots of "is," "was," and "were"? The author's verbs may need strengthening, and you may need to root out the passive voice. Lots of capitalized "And" and "But"? Does it bother you to start a sentence with a conjunction? If not, has the author simply overdone it? How many times is "very" used? Fifty occurrences of "paradigm"? Good grief!

What else can you think of? Please let me know; I'll share your thoughts in the next newsletter: mailto:editor [at symbol] editorium.com

Now let's go to the bottom of the table:

3 manger

2 managment

Hmmm. In this business book, we've got "managment" appearing twice, and "manger" three times. The spell checker would have caught "managment" but not "manger." We now know that we should search for "manger" and replace it with "manager." And we might as well take care of "managment" while we're at it. You'll probably find some pretty strange fish in this end of the net, but without WordCounter, they might have gotten away. Find and replace as needed. If you have lots of them, I recommend fixing them en masse with MegaReplacer:

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

Now let's sort the table alphabetically by word. No, no, wait. First, select all those frequently used words at the top of the table and delete them. That will get them out of the way for what we want to do next. Here's how:

1. Select a whole bunch of words and numbers you want to get rid of.

2. Click Table > Select > Row.

3. Click Table > Delete > Rows.

Okay, *now* let's sort the table alphabetically by word:

1. Put your cursor in the table.

2. Click Table > Select > Table.

3. Click Table > Sort > Column 2, Text, Ascending.

4. Click OK.

Excellent. Now start looking through your list. What do you see? Multiple spellings for "realize/realise"? How about "President" and "president"? Sorting the table by word puts such variations near each other in the list so you can spot them easily. Then, in your main document, you can find and replace as needed.

Knowing how many times each word appears may also help in your decisions about editorial style. If both styles are acceptable, why not go with the one you have to fix the fewest number of times? Whatever your decision, using a word frequency list can alert you to editorial problems before you ever start editing, and it can help you achieve the editorial consistency you desire.

You can download WordCounter here:

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

_________________________________________

READERS WRITE

Judy Stein wrote:

Eric Fletcher writes, "What is particularly useful about this approach is that you can then later collect all of the flagged items in a single step--either for separate review or for use in a style guide. (This method only works for Word 10+.)"

What's Word 10+? I assume it's something beyond Word 2000, because he goes on to talk about a "Highlight all items found in" box--but I don't have one of those.

I replied:

Word 10 is the same as Word 2002 is the same as Word XP. "Word 10+" means Word 10 and anything higher, which is currently Word 11, comprising Word 2003 (PC) and Word 2004 (Mac). Back in the good old days, Word was numbered with, well, numbers rather than years. So we had Word 2, Word 5, and Word 6. With Word 95, however, Microsoft decided to get fancy, but a lot of folks still referred to it as Word 7. Word 97 (and 98) is thus Word 8, Word 2000 (and 2001) is Word 9, and so on.

Meg Cox wrote:

Thanks Eric Fletcher. That's some good stuff that I will wade through when I have the mental energy (it's very complicated!).

Meantime, I have solved my problem of viewing style sheet items in alphabetical order so I can spot near misses as I go along without having to scroll to the proper place each time to insert the new item. (I believe Eric's method would have this happening at the end of the chapter or project rather than all along.)

I also index books, so I have SKY indexing software. I knew this software would solve my problem, but I was stuck because every time I tried to shrink its window so I could tuck it in a corner of my screen, I would get an error message. Well, I decided to just shrink the window bit by bit, ignoring the recurring, and, as it turns out, benign, error message, until I had a nice compact little window to stick in the corner. Now the windows are sharing space nicely.

Now I can type or paste new entries in and immediately see them in context alphabetically next to other entries of the same category--personal name, foreign term, whatever. If I'm typing instead of pasting, autocomplete will let me know right away that the term has been encountered already (perhaps in a previous file if I'm using the color-coding method).

Now I'm wondering: I don't think a Word macro can open a window in another program and order a paste there. That would be very helpful.

If you know of a solution for Meg, please sent it to hints [at symbol] editorium.com.

Pat LaCosse wrote:

As an editor I use VBA to script and extend Word nearly every day. I'm delighted to have found your newsletter.

In "Numbers by Chicago, Part 2" [June 9, 2004], you provided a link to two scripts one might use to eliminate duplicates in a list. Although I'm not too familiar with WordBasic commands, I noticed that your examples were able to handle only duplicates that are adjacent to one another in the list. No problem if you've sorted the list, but what if sorting the list is not necessary or desirable? (There are times, for example, when preserving the order of occurrence is desirable.)

I thought I'd share a technique I've grown to prefer, which eliminates duplicates no matter where they are found in the list. It utilizes VB's dictionary object and it is fast. I've run scripts similar to the one below on files that are 11 MB big, and the difference in speed as a result of using the dictionary object (as opposed to recursively iterating through each paragraph) is remarkable. The dictionary object's comparemode property provides a convenient way for the filtering to be case sensitive if need be. One can read more about the dictionary object's properties and methods in Word's VBA help file. I should mention that I've used the dictionary object only on Windows machines running Word 2000 and 2002. I don't know how available the dictionary object is for other platforms and versions, but those who have access to it will find it quite useful for a variety situations. I use it to create concordances, audit documents for special characters, etc. all the time.

Here is an example with comments. Normally I try to be much more modular in my programming. For example, I would usually put the core functionality here into a sub or function to which I could pass a range object (allowing me to pass it the range of an entire document or merely that of a selection within a document). And I'd make the comparemode an optional argument to pass. Because the purpose here is simply to show the dictionary object in action, I've adapted some code to be a situation-specific script, which allows it to be tested easily on a document. With that disclaimer, here it is:


Sub ListEliminateDuplicates()
'Pat LaCosse
'Adapted from my ConcordanceTools template
'and submitted to the Editorium newsletter
'on June 17, 2004.
Dim para As Paragraph
Dim dict
'Create an instance of the dictionary object
Set dict = CreateObject("Scripting.Dictionary")
'Set comparemode; use vbBinaryCompare
'for case-sensitive filtering
dict.comparemode = vbTextCompare
'Iterate through all the paragraphs in the doc.
For Each para In ActiveDocument.Paragraphs
'If we've already encountered this item,
'then delete the paragraph.
If dict.Exists(para.Range.Text) Then
para.Range.Delete
Else
'If we haven't already encountered this item,
'then add it to the dictionary's keys.
dict.Add para.Range.Text, ""
End If
Next para
Set dict = Nothing
MsgBox "Done!"
End Sub

If you don't know how to use such macros, you can find out here.

Linda DeVore and Leo Wong wrote to say that the lines in last week's DeleteDuplicates macro broke incorrectly in their email and so wouldn't run correctly. Here's a version in which the lines are shorter, which should solve the problem:


Sub MakeCordance()
'Courtesy of the Editorium
'http://www.editorium.com
'Mark an index entry for each word in the document:
Dim myWord
For Each myWord In ActiveDocument.Words
ActiveDocument.Indexes.MarkEntry _
Range:=Selection.Range, Entry:=myWord
Next myWord
'Go to the end of the document:
Selection.EndKey Unit:=wdStory
'Mark place with a bookmark:
ActiveDocument.Bookmarks.Add _
Range:=Selection.Range, Name:="IndexStartsHere"
'Generate an index based on the entries marked earlier:
With ActiveDocument
.Indexes.Add Range:=Selection.Range, _
HeadingSeparator:=wdHeadingSeparatorNone, _
Type:=wdIndexIndent, RightAlignPageNumbers:= _
False, NumberOfColumns:=1, _
IndexLanguage:=wdEnglishUS
.Indexes(1).TabLeader = wdTabLeaderDots
End With
'Go back to the bookmark:
Selection.GoTo What:=wdGoToBookmark, _
Name:="IndexStartsHere"
'Select the index, from the bookmark
'to the end of the document:
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
'Turn the index "field" into actual text:
Selection.Fields.Unlink
'Get rid of the page numbers after the index entries:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ", [0-9]@[^013]"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Go back to the bookmark:
Selection.GoTo What:=wdGoToBookmark, _
Name:="IndexStartsHere"
End Sub

Many thanks to Judy, Meg, Pat, Linda, and Leo for their excellent tips and comments.

_________________________________________

RESOURCES

If you want to get very serious about concordance software, you might want to look at the explanations and resources here:

http://www.uni-giessen.de/~ga1007/ComputerLab/concordance.htm

Making a Concordance

Have you ever needed to make a list of every word in a document? If so, here's a macro that will do it for you automatically. Basically, the macro marks an index entry for every word in your document, generates the index, and removes the page numbers, leaving you with an alphabetical list of words used (at the end of the document). It's sometimes interesting to see what Microsoft Word considers a "word"; periods, commas, and other unlikely items will be included.

To use the macro, open a document for which you need to make a concordance. (Be sure to keep a backup, just in case.) Then, run the following macro on the document (I've included comments to explain how it works):


Sub MakeConcordance()
'Courtesy of the Editorium
'http://www.editorium.com
'Mark an index entry for each word in the document:
Dim myWord
For Each myWord In ActiveDocument.Words
ActiveDocument.Indexes.MarkEntry Range:=Selection.Range, Entry:=myWord
Next myWord
'Go to the end of the document:
Selection.EndKey Unit:=wdStory
'Mark place with a bookmark:
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="IndexStartsHere"
'Generate an index based on the entries marked earlier:
With ActiveDocument
.Indexes.Add Range:=Selection.Range, HeadingSeparator:= _
wdHeadingSeparatorNone, Type:=wdIndexIndent, RightAlignPageNumbers:= _
False, NumberOfColumns:=1, IndexLanguage:=wdEnglishUS
.Indexes(1).TabLeader = wdTabLeaderDots
End With
'Go back to the bookmark:
Selection.GoTo What:=wdGoToBookmark, Name:="IndexStartsHere"
'Select the index, from the bookmark to the end of the document:
Selection.EndKey Unit:=wdStory, Extend:=wdExtend
'Turn the index "field" into actual text:
Selection.Fields.Unlink
'Get rid of the page numbers after the index entries:
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ", [0-9]@[^013]"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Go back to the bookmark:
Selection.GoTo What:=wdGoToBookmark, Name:="IndexStartsHere"
End Sub

If you don't know how to use such macros, you can find out here.

If you want to keep the page numbers, just leave out these lines:

'Get rid of the page numbers after the index entries:

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

With Selection.Find

.Text = ", [0-9]@[^013]"

.Replacement.Text = "^p"

.Forward = True

.Wrap = wdFindContinue

.Format = False

.MatchCase = False

.MatchWholeWord = False

.MatchAllWordForms = False

.MatchSoundsLike = False

.MatchWildcards = True

End With

Selection.Find.Execute Replace:=wdReplaceAll

For certain kinds of projects (catalogs, for example), you may be able to use a concordance to create an index of your document. You can learn more here:

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

Need to create a concordance for a whole bunch of documents at once? Use our MultiMacro program to run the macro above on all documents in a folder:

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

Or, you could use our WordCounter program, which now includes a concordance feature with a frequency count of the words in a document or documents. (This is a free upgrade for registered users.)

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

In other words, WordCounter can now tell you *how many times* each word has been used. How might that be useful for editing? Stay tuned. Over the next few weeks, I'll reveal all.

_________________________________________

READERS WRITE

Neman Syed wrote:

A colleague of mine recently asked me if there was a keyboard shortcut to modify styles (I love keyboard shortcuts 🙂 and I showed him how to assign shortcut keys to Word commands and deal with the Task Pane. Office XP has very poor native keyboard alternatives for the Task Pane, to the point I hardly ever use them, with just a couple of exceptions:

* F6 toggles between the document and the Task Pane. You can then use up/down/tab/shift-tab/enter/alt-down (to open drop-down lists), etc.

* CTRL-TAB cycles through the Task Pane, toolbars, and menu, when you're in one of the Task Pane, toolbars, or menu. If you're in the document, it puts a tab.

Realizing that making these shortcuts may be useful for others (and triggered by Pamela's observation in the 2004-05-12 broadcast that one person's obvious is another person's stunner 🙂 here's my method for solving "Joe's Problem": Assign the keyboard shortcut of ALT-M to the FormatStyleModify command.

Here's how:

1. Tools > Customize.

2. Commands > Keyboard.

3. From the Format category on the left, choose FormatStyleModify on the right.

4. Assign ALT-M or whatever keyboard shortcut you want in the "Press new shortcut key" box. If you choose something that already has an assignation, you'll see it noted in an unobtrusive manner below.

********************************

4a. If desired, change the template from Normal.dot to whatever document/template you want this to apply to. Obviously this selection influences what machines this keyboard shortcut is available on; in Windows 2000 and above, this may only be for the current user. In my case I keep all my modifications, macros, etc. in a file called custom.dot which I automatically throw into Word's Startup folder whenever I'm on a new machine. It's portable and powerful. Note: Only open documents and their templates are eligible candidates here, so to use my personal approach you'll need to manually open whatever startup template/add-in you use to store all your customizations.

********************************

5. OK your way back to your doc.

Your ALT-M shortcut now modifies whatever style your cursor is sitting in. (Not surprisingly, character takes precedence over paragraph.) It certainly saves me time and trouble, and I hope it will for your readers, too!

Many thanks to Neman for this terrific tip.

_________________________________________

RESOURCES

Not to toot my own horn, but I was recently looking through the back issues of this newsletter, available here:

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

Wow, there's an awful lot of good information there! If you didn't know about this archive, now you do. I hope you find it useful.

Numbers by Chicago, Part 2

Our previous article outlined a fairly lengthy Find and Replace routine to make sure inclusive (elided) numbers follow the style outlined in the Chicago Manual. Astute reader Andrew Lockton responded with a technique that is so important, it deserves a second article. Andrew suggested taking the "Find What Expression" wildcard, which takes the form 1, 2, and so on, and putting it not in the Replace With box, where it is ordinarily used, but in the *Find What* box--something I did not know was possible. Hats off to you, Andrew.

Instructions for using the "Find What Expression" wildcard can be found here:

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

Andrew's discovery opens up all kinds of possibilities for various problems I've previously been unable to solve, but let's look specifically at getting numbers by Chicago. The previous method required 18 separate searches. Andrew's brilliant methodology requires only three. Here's the explanation:

1. Numbers that take the form 104-105 need to be converted to 104-5:

Find What:

([1-9])0([1-9])-10([1-9])

Replace With:

102-3

What's going on there is that the first number grouping, ([1-9]), is being referred to by the 1 that follows the hyphen--in the Find What string. See it? Just before the 0 there? That tells Word to find (again) whatever was found by the first number grouping. For example, when the search hits something like "203-205," it says, "Hey, my first number group finds 2 [the first number in 203]. Let's see, is there also a 2 after the hyphen? Yes, there is!" Slicker than snake shoes, as expert word whacker Hilary Powers is fond of saying.

2. Numbers that take the form 104-110 need to be converted to 104-10:

Find What:

([1-9])0([1-9])-1([1-9])([0-9])

Replace With:

102-34

3. Numbers that take the form 111-112 or 119-120 need to be converted to 111-12 or 119-20:

Find What:

([1-9])([1-9])([0-9])-1([1-9])([0-9])

Replace With:

123-45

At first I thought it might be possible to combine 2 and 3:

([1-9])([0-9])([0-9])-1([1-9])([0-9])

But that would also find even hundreds (100, 200), which need to be ignored (100-114 rather than 100-14).

Many thanks to Andrew for the terrific tip.

_________________________________________

READERS WRITE

Alan Seiden wrote:

Here's another caps lock fixer. The program is called AntiCapsLock. It is free to try, but costs $10 to have the program remember one's settings.

http://www.orionsoft.cz/anticapslock.asp

We've set it up so that caps lock only toggles on or off when SHIFT is pressed along with the CAPS LOCK key. It works very well for a fussy computer user.

----------------------------

After reading the article "Numbers by Chicago," Jeanne Pinault wrote:

What I do with elided numbers is just replace all the hyphens with en dashes and then fix whatever comes up wrong when I edit the notes. That's because every set of endnotes I see is wrong in a slightly different way from every other set of endnotes I ever saw, so I have to read every character anyway. I can see that your marvelous find and replace would be a godsend with consistently formatted and voluminous endnotes produced on a regular basis, though. Are en dashes in there someplace?

I responded:

In the Find string, use ^150 (the en-dash code) instead of the hyphen.

----------------------------

Margaret Berson wrote:

I just was looking at your sequential replacement operation for page numbers. Why would you not use a macro that would go through and use the string position functions to evaluate the first digit of the first page number against the first digit of the second page number, deleting the unneeded first digit of the second number if it's the same, and leaving it alone if it's higher?

Wordmeister Steve Hudson sent in a macro that takes things even further. He wrote:

The following solution was designed to not just satisfy the English world with its 0-9 numerics. Use it to reduce hexadecimal addresses, Japanese, or anything. Even if the numbers aren't sequential, like hex, we just use ranges for the find such as "0-9A-F".

It is as simple as possible whilst being as generic as possible. Simpler solutions cannot work for non-English solutions as we cannot guarantee ASCII status. It is fully commented and written for clarity and education rather than speed. It will still run like greased lightning but 🙂


Public Sub NumberCruncher()
'Link this one to your toolbar
'Change any parms as needed from here
NumberCrunch ActiveDocument.Content
End Sub
Public Function NumberCrunch( _
Scope As Range, _
Optional NumberSeparator As String = "-", _
Optional Numbers As String = "0-9" _
) As String
'Another document solution from WordHeretic.com
'Produces short form number ranges anywhere in the provided
'document range. Eg 309-310 into 309-10 and 307-308 into 307-8
'You can use Unicode nnnn by using "^nnnn"
'NumberRange and architecture is for true I18N
'Known Issues: n-n will end up being n-. Eg 300-300 to 300-
'___________________
'Declare
'___________________
Const EndOfWord As String = ">"
Dim NumberRange As Range
Dim FirstNumber As Range
Dim SecondNumber As Range
Dim Separator As Range
Dim AnyNumber As String
Dim LenFirst As Long
Dim LenSecond As Long
'___________________
'Initialise
'___________________
Set NumberRange = Scope.Duplicate
Set FirstNumber = Scope.Duplicate
Set SecondNumber = Scope.Duplicate
'___________________
'Clarity
'___________________
AnyNumber = "[" & Numbers & "]@"
With NumberRange.Find
.Text = AnyNumber & NumberSeparator & AnyNumber & EndOfWord
.MatchWildcards = True
End With
'___________________
'Main program loop
'___________________
While NumberRange.Find.Execute(Replace:=wdReplaceNone)
Set Separator = NumberRange.Duplicate
With Separator.Find
.Text = NumberSeparator
.Execute(Replace:=wdReplaceNone)
End With
'So now we have the entire number range AND
'the separator range, we can calc the numbers
FirstNumber.Start = NumberRange.Start
FirstNumber.End = Separator.Start
SecondNumber.Start = Separator.End
SecondNumber.End = NumberRange.End
'Counting chars is NOT the same as an offset
LenFirst = FirstNumber.Characters.Count
LenSecond = SecondNumber.Characters.Count
'Now lets work out what's the same
'First up, if the second number is shorter than
'the first, it's already been done or is irrelevant.
'Eg 200-7
'If the second number is longer we cannot find common ground
'Eg 97-101
'Thus, we can ONLY operate on equal length numbers.
'Then, test for the number being a dynamic field
'as we can't really change those
If LenFirst = LenSecond And NumberRange.Fields.Count = 0 Then
'Now we need to match every character or finish
'We will shrink our FirstNumber range as we go,
'and delete the secondnumber range as we go
'Char comparisons DO use unicode
While FirstNumber.Characters(1) = SecondNumber.Characters(1)
FirstNumber.MoveStart
SecondNumber.Characters(1).Delete
Wend
End If
Wend
'___________________
'Destroy all objects
'___________________
Set FirstNumber = Nothing
Set SecondNumber = Nothing
Set Separator = Nothing
Set NumberRange = Nothing
End Function
Steve later added:
We may also want to include something like this if the user wants to run the macro on a range of text:
Public Sub NumberCruncherSelection()
NumberCrunch Selection.Range
End Sub

If you don't know how to use macros like that one, you can find out here:

----------------------------

The consistently brilliant Eric Fletcher wrote:

I was interested to see the tip from Meg Cox and Joy Freeman in the last Editorium posting about highlighting all instances of an item. In a job some time ago, some very foreign names were being used throughout. I knew they would cause problems later in the spell check but unless I was careful, a slightly different spelling of the same name would easily slip past. For example, "Mkandawire" might also be "Mkandewire"... I wanted to avoid the tedium of clicking the Ignore button during spell check but still have a way to check the items.

So, in order to both flag a word as already seen and turn off proofing, I created the little macro below. To use it, I select the word (or words) and click the button associated with it. All identical instances (note the MatchCase) are set in green color with no proofing. The resultant green color shows that the word has already been encountered (as noted in your reader's tip).

However, what is particularly useful about this approach is that you can then later collect all of the flagged items in a single step -- either for separate review or for use in a style guide. (This method only works for Word 10+.)

1. In the Find box, leave Find What empty but use Format to select the color (Green in my case).

2. Click the "Highlight all items found in:" box and choose Main Document. The Find button changes to Find All, and when you click it, all instances of the color green will be highlighted.

3. Now for the fun part: close the F&R dialog and choose Copy (Ctrl-C); open a new document and paste (Ctrl-V).

What you get is a list with each found item on a line of its own. You can then sort it and more easily review the list since all identical instances of the same item sort together. (...and I'm sure someone out there will even have a VBA script that could eliminate all duplicates in the sorted list!)

[Editor's note: You'll find such a script here: http://lists.topica.com/lists/editorium/read/message.html?mid=1702467672]

Here's my macro:


Sub FlagThis()
' FlagThis Macro
' Flags current selection as green with no proofing throughout the
document. E Fletcher 2003-10-23
'
Dim flagit As String
flagit = Selection
Selection.MoveLeft Unit:=wdCharacter, Count:=1
With ActiveDocument.Content.Find
.ClearFormatting
.Text = flagit
.MatchCase = True
With .Replacement
.Text = "^&"
.ClearFormatting
'-- colour and no proofing options for replace
.Font.Color = wdColorGreen
.NoProofing = True
End With
.Execute Format:=True, Replace:=wdReplaceAll
End With
Selection.MoveRight Unit:=wdWord, Count:=1
End Sub

Note that I have it set up so the cursor ends up at the end of the first word in the selection. If users want to just add color and not set the proofing off, the ".NoProofing = True" statement should be removed.

I also use a slightly modified version of this method to flag words set in a different language. My Quebec flag button sets the selection in my custom "French" character style [French (Canada) language and font color blue] so I modified the FlagThis macro to set all instances of the selection to the French style. The spell check switches languages on the fly so it checks properly in multiple languages. Then, before I print or release the final version of the file, I modify the style definition(s) to change the language color(s) to automatic.

Many thanks to Alan, Jeanne, Margaret, Steve, and Eric for their terric tips and comments.

Numbers by Chicago

I recently worked on a manuscript with lots of source citations, many of which had page numbers formatted like this:

122-123

I prefer the shorter style recommended in the Chicago Manual of Style (8.69):

122-23

And besides, the manuscript was inconsistent, sometimes using one style, sometimes the other. Not wanting to fix all of these by hand, I decided to put the old wildcard search to work. You can learn about searching with wildcards in my free paper "Advanced Find and Replace in Microsoft Word":

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

The first thing I needed to do was simplify things. Consider the style for even hundreds:

100-109

100-119

100-201

In all such cases, the numbers were already in the correct style, so I decided to just get them out of the way, like this:

Find What:

00-

Replace With:

~~-

(Those tildes are just arbitrary placeholders to be turned back to zeroes later.)

With that taken care of, I originally thought I could change all the other numbers like this:

Find What:

([0-9]{3}-)[0-9]([0-9]{2})

Replace With:

12

That "Find What" string finds any set of three {3} numbers [0-9] followed by a hyphen, followed by a single number [0-9], followed by any set of two {2} numbers [0-9]. The items in parentheses are treated as as a group.

The "Replace With" string replaces the first 1 parenthetical group with itself and the second 2 parenthetical group with itself, leaving out any number [0-9] that was not grouped in parentheses.

That will definitely change 122-123 to 122-23, but it will also change 308-309 to 308-09, so we'll need to get a little fancier. How about this?

Find What:

([0-9]{3}-)[0-9]([1-9]{2})

Replace With:

12

Notice that I've changed that last number range to [1-9] rather than [0-9]. That means numbers like 308-309 will not be found but numbers like 308-319 will. (Come to think of it, that single number in the middle could probably be [1-9] as well, since there shouldn't be any page numbers like 308-019. Of course, you never know.) Now, does that solve the problem?

Well, no. We still need to deal with numbers like this:

398-415

We certainly don't want that changing to 398-15. And what about this?

247-517

Unlikely, I'll admit, but still possible.

And that means we can't do our find and replace all in one shot. Instead, we'll have to do 18 specific searches:

(1[0-9]{2}-)1([1-9][0-9])

(2[0-9]{2}-)2([1-9][0-9])

(3[0-9]{2}-)3([1-9][0-9])

(4[0-9]{2}-)4([1-9][0-9])

(5[0-9]{2}-)5([1-9][0-9])

(6[0-9]{2}-)6([1-9][0-9])

(7[0-9]{2}-)7([1-9][0-9])

(8[0-9]{2}-)8([1-9][0-9])

(9[0-9]{2}-)9([1-9][0-9])

(10[1-9]-)10([1-9])

(20[1-9]-)20([1-9])

(30[1-9]-)30([1-9])

(40[1-9]-)40([1-9])

(50[1-9]-)50([1-9])

(60[1-9]-)60([1-9])

(70[1-9]-)70([1-9])

(80[1-9]-)80([1-9])

(90[1-9]-)90([1-9])

At least that's how it looks to me. If you have a better way, I'd love to hear about it.

You can do the searches by hand if you like. You've got 20 chapters, all in separate files? Let's see--20 x 18 = 360 separate searches. Ouch! Of course, you could use my MegaReplacer program to do them all at once, freeing up your time for something more interesting:

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

Don't forget, we still need to turn those tildes back into zeroes:

Find What:

~~

Replace With:

00

Now all of those page numbers should be in Chicago style. How beautiful!

"What about four-digit numbers?" you ask. I leave it as an exercise for you to work out.

If you'd like this whole thing ready to run in MegaReplacer, here it is:

00-|~~-

(1[0-9]{2}-)1([1-9][0-9])|12+m

(2[0-9]{2}-)2([1-9][0-9])|12+m

(3[0-9]{2}-)3([1-9][0-9])|12+m

(4[0-9]{2}-)4([1-9][0-9])|12+m

(5[0-9]{2}-)5([1-9][0-9])|12+m

(6[0-9]{2}-)6([1-9][0-9])|12+m

(7[0-9]{2}-)7([1-9][0-9])|12+m

(8[0-9]{2}-)8([1-9][0-9])|12+m

(9[0-9]{2}-)9([1-9][0-9])|12+m

(10[1-9]-)10([1-9])|12+m

(20[1-9]-)20([1-9])|12+m

(30[1-9]-)30([1-9])|12+m

(40[1-9]-)40([1-9])|12+m

(50[1-9]-)50([1-9])|12+m

(60[1-9]-)60([1-9])|12+m

(70[1-9]-)70([1-9])|12+m

(80[1-9]-)80([1-9])|12+m

(90[1-9]-)90([1-9])|12+m

~~|00

_________________________________________

READERS WRITE

Mary Russell wrote:

I'm working on a revision of an encyclopedia on world religions that already has a 108-page word list and a 1,000-page index of terms I need to check *everything* against. I'm using your style sheet macro to slap each term I want to check into the style sheet as I go and then doing a separate pass to check them all--and having them alphabetized saves me a lot of scrolling around in those files. By the way, I *love* your macro. I run the style sheet minimized and don't even have to switch back to my original document. You should really be selling this one. I'm usually more restrained, but this really is a great idea.

--------------------------------

Meg Cox wrote:

Joy Freeman on Freelance suggested a new approach that I think will alleviate the style sheet challenge considerably. I haven't tried it yet, but I'm going to on the next chapter I start. She gave her permission to repeat the approach here:

With each occurrence of a new name, search for the same and replace it with itself in a different color (say, blue). Then you know you've already encountered it and don't need to check it against the style sheet. That way you only have to take action with variations and first occurrences. If it's blue, move on through!

I suspect this approach will come in very handy the next time I have a manuscript with hundreds of unfamiliar personal, place, and organizational names, and it will help in simpler projects as well.

Another way it will help: Sometimes in a long chapter it's hard to remember whether the full name of a person or organization has appeared yet (my clients routinely ask for full version on first occurrence in each chapter, then shortened version thereafter). If the changing to blue is done chapter by chapter (and I think it could be handled quickly--I need to think macro on this), blue will mean the full version has already occurred and an abbreviation or last-name-only may be called for. Could be useful for long sets of notes too so I know when it's time to go with a short citation! (Lately I'm seeing plenty of chapters with 70 or more notes.) Oh, and good for parenthetical citations too, so I know what I've already checked against bibliography.

[Editor's note: Our RazzmaTag program would be very useful for this kind of thing: http://www.editorium.com/razzmatag.htm.]

--------------------------------

Brad Hurley wrote:

Steve Hudson wrote:

I'd like to advise you and your readers to avoid Outlook

2003. It has more bugs than the NSW locust plague here in

Australia at the moment. I could fill an article with simple

features that cause immediate failures.

This is almost the opposite of my experience. I've been using Outlook 2003 daily on my Windows 2000 machine since last October, and it has never crashed. I have encountered several bugs and design flaws, but overall my experience has been positive. The much-improved spam filtering and the new three-pane design make it a far better program than previous versions. The upgrade from Outlook 2000 went flawlessly and it handles my large e-mail archive files (300-600 megabytes each) without a complaint. The only serious problems I've noticed so far are:

1. Editing a message in your outbox makes it impossible to send; you have to transfer it to a different folder and send it from there.

2. E-mail address auto-complete doesn't work if your contact's address book entry also has a fax number listed (this is a very frustrating flaw because Outlook should be smart enough to know you're not trying to send a fax when you've composed an e-mail message to someone).

3. Hitting the return button to start a search only works once a session; after that you have to use your mouse to click the "find now" button.

Other than that, I'm satisfied with Outlook 2003; in fact it's the only element in the Office suite that I've found worth upgrading from the 2000 versions.

Many thanks to Mary, Meg, and Brad for their helpful tips and comments.

_________________________________________

RESOURCES

Bruce Koehler wrote:

Another approach to handling accidental press of the Insert key and other keys (e.g. Caps Lock) is a small freeware program called FirstCap. It allows you to set up these potentially problematic keys in various ways such as:

* Disable

* Disable--but with a work-around to re-enable once or continuously sound an alert when pressed

Terrific little program. Just Google search on "FirstCap" for many sites that offer it.

And while I'm at it, here are a few more that would be useful to Word users:

Memokeys: "MemoKeys can help you to fill forms faster, to execute repetitive tasks without having to type every time the same text or keystrokes. The principle is simple: MemoKeys creates associations between key combinations on your keyboard and some predetermined texts or system actions . . . " Uses a Function key (F12, for example) plus an alphanumeric key. Works in all programs.

MinMax extender: adds icons by the "-" and "X" icons at the upper right of a window to allow rollup, expand window to full screen width or height (and undo), etc.

FileEx (shareware--not free): can expand most dialog boxes--a great help in Word--also allows a different default Save destination (great when you're opening a lot of files in one folder but want to save them to another location).

Many thanks to Bruce for suggesting these programs. Bruce also suggested asking newsletter readers if they know of other editing or Word-related shareware and freeware. If you do, please let us know, and we'll list them in the next newsletter: mailto:resources [at symbol] editorium.com

Fixing Typos Automatically

All this talk about editorial style sheets in the past couple of newsletters got me thinking again about lists of automatic corrections. Long ago, I wrote about this and provided a couple of such lists:

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

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

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

I now realize, however, that those lists don't include nearly as many typographical errors as they could. I'm talking about errors like these:

abbout (about)

yeild (yield)

yera (year)

yoiu (you)

yoiur (your)

So here, for your editorial pleasure, is a giant list (more than 1,200 entries) compiled from various typo and AutoCorrect collections:

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

The list is currently set up for use with our MegaReplacer program, with entries like this:

abbout|about+w

yeild|yield+w

yera|year+w

yoiu|you+w

yoiur|your+w

Words before the pipe symbol (|) contain the typos. Words after the pipe symbol are their replacements. And the +w at the end of each entry tells Word to search for "Whole words only." MegaReplacer will run such a list on the active document, all open documents, or all documents in a folder, fixing all of the typos in one fell swoop.

Of course, Word's spell checker will also catch these typos--if you want to click, click, click through them all manually. But why not put MegaReplacer to work while you do something more worthwhile? Of course, running that giant list on a bunch of documents could take a while, so you might want to (1) pare down the list to include only those entries you think you'll really need and (2) run it on fewer documents at a time. You can learn more about MegaReplacer here:

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

You might also want to use some of these entries (minus the pipe symbols and +w's) in your AutoCorrect list (some of them are probably already there). Feel free!

_

FROM WORD 2K TO 2003: WORD'S TASK PANES VBA REFERENCE

Wordmeister Steve Hudson sent his most recent article in his series about Word 2003--a sneak preview especially for Editorium Update readers before the article is published elsewhere. The article covers one of Word's most important features, the Task Pane, with an emphasis on VBA, and Steve covers the topic in almost unbelievable detail. If you want the real scoop, look no further. You can download Steve's article by clicking here:

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

Steve also wrote:

I'd like to advise you and your readers to avoid Outlook 2003. It has more bugs than the NSW locust plague here in Australia at the moment. I could fill an article with simple features that cause immediate failures.

If you are happy to live with plain text emails, you get fewer problems. Not none, fewer. Rules are broken, insofar as there are several options that crash Outlook when you select them. Contacts has a few problems that sporadically cause crashes; even picking names from your address book goes belly up regularly. 🙁 No Service Packs as of yet.

I'm putting up with it, as the rest of Office 2003 is very nice.

Many thanks to Steve for doing intense research on Office 2003 and making it available for our use.

_________________________________________

READERS WRITE

Andrew Savikas wrote:

Two quick tips came to mind while I was checking out your archives that might interest readers of your newsletter:

1. The primary motivation for most users when re-assigning the Insert key is to avoid accidental invocation of the cursed Overtype feature; adding a new function to the Insert key is just a bonus. To accomplish the former semi-permanently, just intercept the command:


Sub Overtype()
' Do nothing (or do something else)

End Sub

Then users can re-assign or un-assign the Insert key at will, without any fear of Overtype returning.

[For more information, see the past newsletters here:

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

http://lists.topica.com/lists/editorium/read/message.html?mid=1701366500]

2. Style aliases are indispensable but can cause problems when exporting to a different format. This macro removes them (Word 2000+ for Windows):


Sub RemoveStyleAliases()
Dim sty As Style
For Each sty In ActiveDocument.Styles
sty.NameLocal = Split(sty.NameLocal, ",")(0)
Next sty
End Sub

[For more information, see the past newsletter here:

http://lists.topica.com/lists/editorium/read/message.html?mid=1703188741]

If you don't know how to use such macros, you can find out here.

--------------------------------

Meg Cox wrote:

Some editors don't like to alphabetize an editorial style sheet as they go along. For me, it's essential if the style sheet is to be usable--especially in a book with a million personal and place names, and especially if it's about an unfamiliar geographical region.

Without keeping the style sheet in alphabetical order, I'm not going to spot the close-but-not-quite situations. Case in point: in my style-sheet-nightmare project, the author was rendering the names every which way. Was it Leon Mba or Leon M'ba? With an accent on the e or not? Denis Sassou-Nguesso with or without the accent, with or without the hyphen? Sassou-Nguesso as surname only, or just Nguesso? Or Sassou Nguesso? Some names appeared infrequently enough that I never would have been able to remember whether they had come up before and how they had been rendered. (This 700-page manuscript covered politics in 14 francophone African countries over a period of 120 years.)

Even in easier projects, it's the alphabetization that enables me to spot the inconsistencies as I go along so I can change them all to the same thing. In the 14-countries project, it would have been no easy matter to go back and search and replace later because the versions of the names varied too widely, so I had to decide on the first occasion of each inconsistency. If the author wanted to go with a version different from what I had settled on, once they were all consistent I would have been able to do a global search and replace. (Thank goodness in this case cleanup was in-house!)

If I wasn't working in history and political science, this wouldn't be as much of an issue.

As it turned out, I didn't come up with a good way to do what I wanted to do. Maybe I could have with more fiddling, but I finally needed to just give up and keep moving through all the names.

Many thanks to Andrew and Meg for their helpful tips and comments.

_________________________________________

RESOURCES

The Design Science site has some marvelous advanced tutorials on Word's AutoCorrect feature:

http://www.dessci.com/en/support/tutorials/autocorrect/tutorial.htm

http://www.dessci.com/en/support/tutorials/autocorrect/advanced.htm

Restoring Superscript to Note Numbers

I get manuscripts with all kinds of weird formatting, but recently I got one from which all formatting had been removed. That might have been all right, but the note reference numbers were no longer superscript; they all looked something like this.42 I wasn't about to fix all those by hand, so I came up with this solution, which I hope you'll find as useful as I did:

1. Back up your documents, just in case.

2. Call up Word's Replace dialog (Edit > Replace).

3. In the "Find What" box, enter this (just copy and paste it from this article):

([! 0123456789,:$(])([0-9]{1,})

4. In the "Replace With" box, enter this:

12

5. Click the "More" button if it's available.

6. Put a check in the "Use wildcards" checkbox.

7. Click the "Replace All" button.

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

(*)

9. In the "Replace With" box, enter this (formatted as superscript):

1

10. Click the "Replace All" button.

All of your note numbers should now be in glorious superscript.

Want to know more about two-step finding and replacing?

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

Want to know more about wildcard searching?

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

Want to know how to remove directly applied document formatting without removing superscript, italic, bold, and so on?

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

_________________________________________

READERS WRITE

After reading last week's newsletter with its editorial style sheet macros, Jim Pinkham wrote:

You can also overcome the limitation on having only two Word docs open to make Hilary's macro run by simply specifying the windows you wish to switch between in the macro. For example, here's a snippet from one of mine:

Selection.SelectRow

Selection.Cut

Windows("Blue Rows.doc").Activate

Selection.Paste

Windows("Weekly Improvement Analysis March 22-28.doc").Activate

When I use this macro, I'll create a new "Weekly Improvement Analysis" doc each time--so I simply edit the file name accordingly.

--------------------

Pamela Angulo wrote:

As I read today's newsletter, 2004/05/05: Editorial Style Sheet Macro, I wondered why anyone editing and creating a style sheet on a computer would be concerned about pasting copied style terms by letter or in alphabetical order. (Organizing terms by type--names, places, scientific terminology, etc.--now, that I understand.)

I copy terms to my style sheet as I go, in the order they present themselves--more or less from top to bottom of the manuscript. For some jobs (e.g., chapters by multiple authors for the same book, or individual articles for inclusion in a single magazine issue), I keep track of chapter, article, or author for each term as well. But however I handle the initial list, I sort the terms alphabetically later, *not* while I'm copying and pasting (too much time, and too much brain!).

I create different versions of the style sheet for different purposes: A single comprehensive alphabetical list for a multiple-part project allows me and the proofreader to cross-check terms across the entire project, which is always helpful; several individual alphabetical lists sorted by chapter, article, or author allow me to send only the relevant list to each author for review.

With Table > Sort in Word, arranging my style sheet in alpha order is a no-brainer, and I like that after a long day at the helm. 🙂 BTW, some people don't realize that this command will work on *any* list; the list doesn't have to be in a table.

A while back, a copyeditor posted to Freelance asking how to convert her style sheet into a table so she could sort it. It struck me *hard* then that one person's "no duh!" (it's soooo obvious) is very often another person's "no way!" (never would have thought of that).

Many thanks to Jim and Pamela for their helpful tips and observations.

_________________________________________

RESOURCES

The EServer TCLibrary of editing articles has a wealth of information on all kinds of publishing topics. Wow, look at all this great stuff!

http://tc.eserver.org/dir/Articles/Editing

Editorial Style Sheet Macro

Last week's newsletter provided a style sheet that editors can use to keep track of style decisions while editing in Microsoft Word. If you didn't get that style sheet, you can download it here:

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

Hilary Powers was kind enough to provide her StyleThat macro in last week's newsletter, and this week I've adapted that macro to work with the editorial style sheet. If you select some text in a document you're editing and then run this macro, it will switch to your editorial style sheet and paste the text under the alphabetical heading where it belongs: ABCD, EFGH, and so on. See last week's newsletter for more information:

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

And now, here's the macro:

'THE MACRO STARTS HERE
Sub StyleThat()
'Macro adapted by Hilary Powers 1/30/04; updated 4/6/04
'Adapted by Jack M. Lyon for use with editorial style sheet
If Selection.Type = wdSelectionIP Then  'No selection
GoTo HedBack
Else
FirstChar = Asc(Selection.Characters.First)
If FirstChar > 64 And FirstChar < 69 Then MySearch = "ABCD^p"
If FirstChar > 68 And FirstChar < 73 Then MySearch = "EFGH^p"
If FirstChar > 72 And FirstChar < 77 Then MySearch = "IJKL^p"
If FirstChar > 76 And FirstChar < 81 Then MySearch = "MNOP^p"
If FirstChar > 80 And FirstChar < 85 Then MySearch = "QRST^p"
If FirstChar > 84 And FirstChar < 91 Then MySearch = "UVWXYZ^p"
If FirstChar > 96 And FirstChar < 101 Then MySearch = "ABCD^p"
If FirstChar > 100 And FirstChar < 105 Then MySearch = "EFGH^p"
If FirstChar > 104 And FirstChar < 109 Then MySearch = "IJKL^p"
If FirstChar > 108 And FirstChar < 113 Then MySearch = "MNOP^p"
If FirstChar > 112 And FirstChar < 117 Then MySearch = "QRST^p"
If FirstChar > 116 And FirstChar < 123 Then MySearch = "UVWXYZ^p"
If FirstChar > 90 And FirstChar < 97 Then MySearch = "Comments:^p"
If FirstChar < 65 Or FirstChar > 122 Then MySearch = "Comments:^p"
Selection.Copy
WordBasic.NextWindow
WordBasic.StartOfDocument
Selection.Find.ClearFormatting
With Selection.Find
.Text = MySearch
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
End With
Selection.Find.Execute
Selection.MoveRight
Selection.Paste
Selection.TypeParagraph
GoTo Final
End If
HedBack:
WordBasic.NextWindow
Selection.MoveRight Unit:=wdCharacter, Count:=1
Final:
End Sub
'THE MACRO ENDS HERE

If you don't know how to use such macros, you can find out here.

And you can learn how to assign them to a hot key here:

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

Note that you don't have to use the macro with *my* style sheet. It will work with any document in which you've included the following headings, each followed by a carriage return:

ABCD

EFGH

IJKL

MNOP

QRST

UVWXYZ

Comments:

_________________________________________

READERS WRITE

Last week, expert word whacker Hilary Powers sent her StyleThat macro, which I proceeded to gum up. The problem was, it didn't want to work correctly in Word 2000; possibly some of the commands are specific to Word 2003. At any rate, here is Hilary's macro in its pristine state, and many thanks to her for providing it.

Hilary wrote, "The macro relies on having two [and only two] files open at a time. The truly charming thing is that you can use one hot key for both chores: putting something on the style sheet and also priming the style sheet for its next use and returning to the main document.

'THE MACRO STARTS HERE
Sub StyleThat()
' Macro adapted by Hilary Powers 1/30/04; updated 4/6/04
If Selection.Type = wdSelectionIP Then
GoTo HedBack
Else
Selection.Copy
WordBasic.NextWindow
Selection.PasteAndFormat (wdPasteDefault)
GoTo Final
End If
HedBack:
Selection.TypeParagraph
WordBasic.NextWindow
Selection.MoveRight Unit:=wdCharacter, Count:=1
Final:
End Sub
'THE MACRO ENDS HERE

If you don't know how to use such macros, you can find out here.

And you can learn how to assign them to a hot key here:

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

_________________________________________

RESOURCES

I've been fighting the battle against spam (junk email) but not very effectively, even though I've tried a couple of top-notch spam-fighting programs. Then this week I decided to try SpamArrest, and I'm thrilled to say it's actually won the war. Boy, has my inbox been quiet.

When people send me an email message, they receive an email message in return that asks them to click a link to register themselves (a one-time operation) as someone who can send me messages. Spammers, of course, won't bother to do this, which basically means no more spam. It's easy to preregister family, friends, associates, and email newsletters to which I subscribe. The completely online program (no software involved) gives me complete control over how spam is handled, and it's very easy to use.

If you'd like to know more, click here:

http://spamarrest.com/affl?1403707

And if you decide to sign up, please do so through the link above. Since I'm now a SpamArrest affiliate, your support will help keep Editorium Update alive and kicking. Thanks!

Changing Word's Memory Allocation

Editors are often afraid to work on big documents in Microsoft Word. I routinely work on documents larger than 300 pages, so I'm not sure what all the fuss is about. I do believe in having plenty of RAM (random access memory) on a computer (at least 256 megabytes), so that helps. Also, most of my documents don't include graphics, which I know can bog things down in Word.

If you need to work on big documents with lots of graphics and find that Word often runs slowly or locks up, you may appreciate a tip from Word guru Woody Leonhard:

http://www.wopr.com

On page 270 of his book "Word 97 Annoyances," Woody explains how to change Word's memory allocation. Here are the basic instructions:

1. Run Regedit (Start > Run > Regedit).

2. Find HKEY_CURRENT-USERSoftwareMicrosoftOffice8.0WordOptions. [You might have a different version number, such as 9.0.]

3. Double-click on the key and back it up by clicking Registry > Export Registry File. If something goes wrong, this will let you restore the existing settings later.

4. Click Edit > New > String Value. Type in the name "CacheSize" and hit Enter twice. Type in 2048 and hit Enter.

5. Click Edit > New > String Value. Type in the name "BitMapMemory" and hit Enter twice. Type in 2048 and hit Enter.

6. Click File > Exit to leave the registry and save your changes.

What this does is tell Word to reserve 2048 KB of memory (instead of the meager default of 64) for documents (CacheSize) and graphics (BitMapMemory).

You don't have to use 2048, either; you can use lesser amounts, such as 1024. It's up to you. But the more you use, the less memory will be available for other programs that are running.

Don't mess with anything else in the registry. Doing so can cause all kinds of problems. And even for these settings, you change them at your own risk.

Macintosh users should simply be able to change the memory allocation for Microsoft Word.

Interested in learning more about Woody Leonhard's classic book "Word 97 Annoyances"? You can check it out here:

http://www.woodyswatch.com/l.asp?1565923081

_________________________________________

READERS WRITE

After reading the article "Show Me the Menu," Michael C. Coleman wrote:

Another trick for viewing the full menu is to double-click the menu headings.

Terri Svilar wrote:

My question has to do with publishing a document created in Word that contains color. Is there a way to separate the color from the text? I work at a small community college, and every semester we publish a course schedule. Most of the text is not highlighted, but there are certain entries that are highlighted with a light yellow so that students can easily find them.

It takes the person who gets this ready to be sent to the publisher a considerable amount of time to convert from Word to a format the printers can use. What takes her the most time is the highlighting, and then sometimes the highlighting doesn't match the printed words.

I responded:

The best way to approach this, in my opinion, is to use character styles to format the words that need to be in color. If you don't know about character styles, Word's Help file will tell you about them. You could create a character style named something like "Highlight" and apply it to the words in question. Then, when the file goes to the printer, it can be imported into QuarkXPress (or some other typesetting program), and the character styles can be formatted in color as needed in the typesetting program.

If your files currently use Word's built-in highlighting rather than character styles, you can use Word's Find and Replace feature to find highlighting and replace it with your character style.

Many thanks to Michael and Terri for their messages.

_________________________________________

RESOURCES

A few weeks ago this newsletter included a notice for a presentation by expert word whacker Hilary Powers to the Bay Area Editors' Forum. The notes and tipsheet for the presentation, "Electronic Editing: With Your Computer, Not Just On It," are now available online here:

http://www.editorsforum.org

Click "Forum Index" (on the right) and "Work Support & Tools (on the left)," and you'll see the titles in the alphabetical list (in the middle).

Don't miss this incredible resource! Hilary really knows her stuff, and the notes and tipsheet include tons of truly useful information that can save you hours of work and frustration.

While you're there, check out the other resources and articles available from the Bay Area Editors' Forum.

From Word 2K to 2003 Part 1–Looking up the Mountain

[Editor's note: This week marks the first installment in a series of reports by Word expert Steve Hudson on Word 2003--installation, features, and much, much more. If you're thinking of upgrading, you won't want to miss it. Next week, we'll return to our regularly scheduled feature articles and include the rest of Steve's installments in his own column as they become available. Many thanks to Steve for making them available!]

I've got a stack of research to do on using all these new Word objects (that's "features," for those who don't understand VBA-speak) that have started appearing so we've all got some idea of what's there. So I organised a free copy of Office 2003 to review. When I say free, I do NOT mean pirated--being a Word guru occasionally has a few tiny advantages.

I thought I could knock this article over in a few days. Fortunately for us, unfortunately for the article, there is a lot of new stuff available. So this is going to be a multi-part series for a little while to come. These articles do NOT go into using the new features all that much; it is more meant to give an overview of the changes to expect and help prepare you for the different ways you can work, or not, in Word 2003.

Installation

Before you can play, you have to build the ballpark. So we spent hours installing the suite of Office products I use or require. The much-anticipated "perfect install" was far from that.

First problem was it does not upgrade Outlook 2000, nor allow its dual existence with Outlook 2003. We stupidly believed the dialog and thought it would be OK to continue with the other stuff--but the install went belly up fairly quickly. Shutdown restart just to be sure to be sure. Back up Outlook PST's just in case of splat or regression. Removed Outlook and reran the install of the Office core components--Word, Excel, Outlook, Access, PowerPoint, InfoPath and Publisher all come bundled in tightly together. This worked OK.

To be specific, we only asked to keep the old Word 2000 and delete the rest of the old components.

Components

Visio, OneNote and FrontPage all came separately. The new 2003 Outlook features are pretty good, but it's a bit cluttered and reduces the number of messages on screen at once so you have to scroll around more to find stuff. The blurb annoyingly refers to this in the opposite, "Less scrolling with our new Bulldust!" Installing the patches took a fair while--there are quite a few already. Everything worked as planned, and the Office Update site provided the last, only four days old, patch. Started up the different products--you only have to load one from the core set, not each one--and their online activation with the supplied serials worked like a treat--quick, automatic and seamless.

OneNote is quite cool, a post-it note manager with some extra cool features--it is way more than Outlook's notes. I am sure it will creep into the workflow for many users, being more than a clipboard but less than a Word document. But that's enough about Office--these articles are about Word!

Plug-ins

I found a few add-ins available on the Office site already for Word 2003--a remove metadata tool--don't know how far this goes, but it does address some common, difficult metadata problems--and a smart tag add-in for dates and phone numbers.

Duelling versions--but both die at once

The dual running of Word 2000 and 2003 is already painful--the office installer almost re-installs each one when you open a new session. Spell "wait state" for me please. However, do note that I AM currently running both versions at the same time even, with NO problems or conflicts. A huge step forward. As I tend to load up a Word session for many hours, I can live with that. Also, if you don't load the other version in between sessions, the 're-install' doesn't trigger. WHEW!

The only down side I discovered is cascading failure. Crash one Word session, the other comes tumbling down as well. This could be limited to the type of crash, can't tell as yet. It was incredibly satisfying seeing each error report actually loading with Microsoft rather than the quick "OK, we already know about this one" response. Yet again, I manage to stuff things up in new and amazing ways--the power of the guru!

Copyright ? 2004 by Steve Hudson. All rights reserved.

_________________________________________

READERS WRITE

Melissa L. Bogen wrote:

For one client, I have to insert coded text at the top of each file. I want to write a macro (or find some other fast way) to add this big chunk of text. Up until now I have been copying and pasting the chunk of text from an old manuscript and updating it for the ms being edited. I think automating this step will speed things up. I'd like to write a macro that will go to the top of a file and insert the copy. Then using your MultiMacro program, I can run that macro along with some other macros I've written.

I'm a tad rusty on recording macros. I tried to write a macro that searched for a character string (this client always inserts the same character string at the top of every file) and replaced it with the desired basic chunk of text. However, I crashed Word twice now. Maybe MS Word doesn't like that the "insert what" field in my search and replace that I tried to run while recording the macro had a lot of "^p" for hard returns. (The chunk of text includes about 8 lines of text.)

Can you point me to a place where I can find a solution to adding a chunk of text to the top of every file?

I responded:

The number of times you use ^p shouldn't matter. The ^p code should work fine.

Are you really writing the macro, or just recording it? If you're just recording it, you should be able to:

1. Go to start of document (CTRL + HOME). 2. Replace [character string] with [your chunk of text] (CTRL + H).

And then run the macro.

But that reminds me: The longest chunk of text you can have in the Replace With box is 255 characters. So if your chunk of text is longer than that, that could be the problem.

The sneaky way around this is to:

1. Select and copy the chunk of text to the Clipboard. 2. Find [character string]. 3. Replace with ^c (which is the magic code for "whatever is on the Clipboard."

Melissa replied:

Yup, the chunk of text is long. I tried your sneaky way around it (recorded that as a macro) and it worked great. So now I have a macro, but there needs to be something on the clipboard for it to work. Thus I also saved the chunk of text as AutoText, using Brad Hurley's instructions you provided in this week's newsletter. Now I can insert the AutoText into one document, highlight the inserted boilerplate and hit Ctrl + c to add the boilerplate to the clipboard, then run the macro with a bunch of others using your MultiMacro. All the files in a folder have the text inserted.

Many thanks to Melissa for her questions and tips.

_________________________________________

RESOURCES

Want to see Microsoft's overview of Word 2003? You'll find the official party line here:

http://www.microsoft.com/office/word/prodinfo/default.mspx