Marking Revisions for Review in Wordperfect

This week one of the editors I work with needed to show tracked revisions to an author she's working with. The problem was, the author used WordPerfect, not Microsoft Word. We tried opening the marked-up Word document with WordPerfect, but no go. Additions were there, marked in red, but deletions had reverted to regular text. Saving the document in various formats and then opening in WordPerfect brought us no joy. What to do? Well, how about a macro that checks and formats each revision? If it's an insertion, color it blue and accept it; if it's a deletion, mark it with strikeout, color it red, and accept it. Then save the document in Rich Text Format (RTF). When it's opened in WordPerfect (or any other word processor that accepts RTF), all of the changes will be visible. Here's the macro, which I hope you'll find useful:


Sub FormatRevisions()
Dim ThisRevision As Revision
For Each ThisRevision In Selection.Range.Revisions
Application.Run MacroName:="ToolsRevisionMarksNext"
If ThisRevision.Type = wdRevisionInsert Then
With Selection.Font
.Color = wdColorBlue
End With
ThisRevision.Accept
GoTo Continue
End If
If ThisRevision.Type = wdRevisionDelete Then
With Selection.Font
.StrikeThrough = True
.Color = wdColorRed
End With
ThisRevision.Reject
GoTo Continue
End If
Continue:
Next ThisRevision
End Sub

If you don't know how to use such macros, you can learn how here:

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

_________________________________________

READERS WRITE

If you were unable to run the style macros in the past few newsletters, you may find this message from Eric Fletcher helpful. I already knew about Eric's tip here, but I keep forgetting to implement it, in spite of Steve Hudson's efforts to educate me. Please accept my apologies. Eric wrote:

Your style listing macros came at a perfect time for me as I'd just received a large file full of oddball styles (actually, it was from a French version of Word so the style names were also all in French!).

However, I thought I'd pass along a tip about future macros. If users have the "Require variable declaration" option set (Tools | Options dialog in VBE), these macro won't run until they add the following line to declare the "sty" variable:

Dim sty As Variant

Defining variables is not entirely necessary but is recommended. If the option is set in VBE, it sets "Option Explicit" at the top of the macro editing window and forces all variables to be defined with Dim statements. I was tearing out what hair I have left trying to work out why some of my previously-working macros started displaying errors until I realized that it had happened after I'd followed someone's advice about setting the option.

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

Donna Payne wrote:

I have a variation of the list styles in use macro. This is from my company's latest book, Word 2003 for Law Firms.


Sub DisplayAllStylesInUseAtInsertionPoint()
Dim oStyle As Style
Dim oRange As Range
Set oRange = Selection.Range
oRange.Collapse wdCollapseStart
For Each oStyle In ActiveDocument.Styles
If oStyle.InUse Then
oRange.InsertAfter oStyle.NameLocal
''' Some Styles cannot be displayed
''' in particular contexts
On Error Resume Next
oRange.Style = oStyle.NameLocal
If Err.Number <> 0 Then
oRange.InsertAfter " (Style Not Displayed)"
End If
On Error GoTo 0
oRange.InsertParagraphAfter
oRange.Collapse wdCollapseEnd
End If
Next oStyle
End Sub

Many thanks to Eric and Donna.

_________________________________________

RESOURCES

After reading about Copernic Desktop Search (for PC) in last week's newsletter, JM, a Macintosh user, wrote:

For years [similar search capability] has been built into the operating system as part of Sherlock, the file finder. I use it almost every day. Doesn't search browser history, as far as I know. I'm on OS 9.2; assume this wonderful thing has survived the switch to OS X.

Romke Soldaat wrote:

"This mail is not entirely free of self-promotion, but if you're interested in new add-ins for Word, you may want to have a look on http://www.wordtoys.com. This package contains quite a few features that might interest editors and other linguistic professionals."

I checked out Romke's WordToys macro package, and it's chock-full of useful features. It's also free!

http://www.wordtoys.com

Many thanks to JM and Romke.

Style Macros

The August 18 issue of Editorium Update featured a macro to delete styles that exist in a Word document but are not used in that document. While I was writing that macro, I also wrote a couple of others that I thought you might find useful.

The first macro, ListCustomStyles, lists (at the end of the document) any custom styles in that document. If you need to know what weird styles your client is using, this macro will tell you what they are.

The second macro, ListStylesInUse, lists (at the end of the document) any style being used in that document.

If you don't know how to use macros like these, you can learn how here:

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

And now, here are the macros. Enjoy!


Sub ListCustomStyles()
For Each sty In ActiveDocument.Styles
If sty.BuiltIn = False Then
Selection.EndKey Unit:=wdStory
Selection.InsertAfter Text:=sty.NameLocal
Selection.InsertParagraphAfter
End If
Next sty
End Sub
Sub ListStylesInUse()
For Each sty In ActiveDocument.Styles
If sty.InUse = True Then
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles(sty)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
Selection.EndKey Unit:=wdStory
Selection.InsertAfter Text:=sty.NameLocal
Selection.InsertParagraphAfter
End If
End If
Next sty
End Sub

_________________________________________

READERS WRITE

In the August 11 issue, Francelia Sevin wrote:

"On my Mac in Word 2001, toggling the track changes on/off doesn't work. I still cannot copy and paste text and include the tracked changes. I have upgraded with the latest patches for 2001 and that hasn't made any difference."

I asked for help with this, and Hilary Powers responded:

That sounds like the PC Word 97 tracking-copy bug, alive and well in Mac Word 2001. If so, the PC workaround--bookmarking the material and inserting it in its new spot (with tracked changes turned off in the receiving document)--should work just fine. To move something in the same document, save the bookmarked file under a different name, then reopen the active file and turn off tracking, insert the bookmarked passage from the copy, and delete it from its original location. Then turn the tracking on again, and you're back in business.

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

Karen Bojda responded to the same question:

Well, there's the workaround I learned about on CE-L, but for some reason I think you already know about this one 😉

https://listserv.indiana.edu/cgi-bin/wa-iub.exe?A2=ind0208E&L=copyediting-l&P=R613

"This is a known 'issue' (bug) in Word 97/98. It's been fixed in Word 2000 and higher. A workaround is to insert the text (Insert > File) into the new document rather than paste it. If you don't want to insert the whole doc, you can bookmark just the part you need and then enter the name of the bookmark into the 'Range' box of the Insert dialog."

I can confirm that this works in Word 98 on the Mac. You have to save a copy of the file under a different name, since Word won't let you insert a file (or even a bookmarked part of a file) into itself. It might be a cumbersome workaround, but I've used it and been grateful to know about it.

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

A more detailed explanation of how to do this is provided in the March 24 issue of Editorium Update:

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

Many thanks to Hilary and Karen.

_________________________________________

RESOURCES

Copernic Desktop Search is a powerful (and free!) file indexing and search engine for Windows computers. The website says:

"Easily search your entire hard drive in less than a second to pinpoint the right file, e-mail, music or pictures.

"CDS brings the power of a sophisticated, yet easy-to-use search engine right to your PC and allows you instantly to search files, e-mails, and email attachments stored anywhere on your PC hard drive. It executes sub-second searching of Microsoft Word, Excel, and PowerPoint files, Acrobat PDFs, and all popular music, picture and video formats. CDS also searches your browser history, favorites, and contacts."

http://www.copernic.com/index.html

Thanks to Keith Soltys for bringing this program to my attention. If you're a Mac user and know of a similar program for Macintosh, please let me know.

Indexing with Page Breaks from Quark

I started indexing a book yesterday, and I wanted to work on the text of the document in electronic form, with page breaks that matched those of the galleys, which had already been typeset in QuarkXPress. After a little experimentation, I figured out the following procedure:

1. Ask the typesetter to provide a postscript file, exported from QuarkXPress.

2. Open the postscript file using the free Ghostscript and GSview programs:

http://www.cs.wisc.edu/~ghost/

3. In GSview, click Edit > Text Extract and save the resulting file to the desktop.

4. Open the file in Microsoft Word. Wow! All of the page breaks are exactly where they're supposed to be (inserted as manual page breaks). Of course, formatting has been lost (since this is a text file), but for pure indexing purposes that doesn't matter.

5. Click File > Page Setup > Layout and set paper size to 22 by 22 inches. Why? So Word won't insert any automatic page breaks and thus throw off pagination.

6. Insert a section break (Insert > Break > Odd page) between the book's front matter and chapters to prepare for step 7.

7. Put the cursor in the front matter, click Insert > Page Numbers, click the Format button, and specify a number format of lowercase Roman numeral. Also specify that page numbering should start at page i. Then click OK and click OK again.

8. Put the cursor in the first chapter, after the section break, click Insert > Page Numbers, click the Format button, and specify a number format of lowercase Arabic numbers. Also specify that page numbering should start at page 1. Then click OK and click OK again.

Now, when the cursor is in the front matter, the far left side of Word's status bar will display the correct page number in Roman numerals. When the cursor is in the chapters, the far left side of Word's status bar will display the correct page number in Arabic numbers. And when the index is generated, the page numbers will be Roman or Arabic as required.

After I was finished with all this, I began indexing with pleasure. Now you can too.

_________________________________________

READERS WRITE

After reading the article on pasting tracked revisions (August 11 issue), Francelia Sevin wrote:

"On my Mac in Word 2001, toggling the track changes on/off doesn't work. I still cannot copy and paste text and include the tracked changes. I have upgraded with the latest patches for 2001 and that hasn't made any difference."

I tried this on my Mac with the same result. It seems Word 2001 doesn't support this feature. If you're a Mac user, gentle reader, and know a way around this problem, please let me know.

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

William T. Buckley wrote:

"What practical use is there for Word's 'Bar' option in setting tab types. (Please, no jokes about my not knowing uses for a bar tab!) ;~) The option looks very handy if I could think of a use for it, but none comes to mind."

I responded:

To draw a vertical line through the text of your document. 🙂

I found this on Microsoft's site:

"When you set a bar tab stop, a vertical bar line appears where you set the tab stop (you don't need to press the TAB key). A bar tab is similar to strikethrough formatting, but it runs vertically through your paragraph at the location of the bar tab stop. Like other types of tabs, you can set a bar tab stop before or after you type the text of your paragraph."

What that means | is that you could have

some text like | this so you could, say,

compare lines of | poetry or other text.

How about listing foreign language equivalents?

Merci. | Thank you.

Je ne sais pas. | I don't know.

How about drawing T accounts for use in accounting, or for analyzing pros and cons?

_____________________

|
|

|
|

|

Honestly, until your message, I'd never even heard of this feature. 🙂

But maybe it could come in handy.

Many thanks to Francelia and William.

_________________________________________

RESOURCES

Microsoft has created an interesting set of multimedia Word tutorials called "So that's how! Great Word features." Learn about Word's new reading layout view, international characters and symbols, and much more:

http://tinyurl.com/44e2w

Deleting Unused Styles

I frequently edit books that are compilations of articles by various authors. Some know how to use Word pretty well; others don't have a clue. Those in the latter category either don't use paragraph styles or create styles that aren't needed. After I've fixed and consistently applied the styles I need, I like to get rid of the other unused styles the authors have created. The following macro seems to do the job quite well. Maybe you'll find it useful:

Sub DeleteUnusedStyles()
'Courtesy of the Editorium
'www.editorium.com
For Each sty In ActiveDocument.Styles
If sty.BuiltIn = False Then
If sty.InUse = False Then
sty.Delete
Else
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles(sty)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found = False Then sty.Delete
End If
End If
Next sty
Selection.HomeKey Unit:=wdStory
End Sub

If you don't know how to use such macros, you can learn how here:

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

You'd think the macro could be a lot shorter:

For Each sty In ActiveDocument.Styles
If sty.BuiltIn = False Then 'Ignore built-in styles
If sty.InUse = False Then sty.Delete
End If
Next sty

But Microsoft Word, ever uncooperative, considers any style that has *ever* been used in a document to be "in use," even if the text formatted by that style has long since been deleted. That means a style can be "in use" even if it's not applied to text anywhere in the document. So, to see if a style is *really* in use, we have to search for text using that style. If no such text is found, then we know that the style really isn't in use and can be deleted.

Note that the macro completely ignores Word's built-in styles, since these *can't* be deleted.

_________________________________________

READERS WRITE

After reading last week's article on pasting tracked revisions, Hilary Powers responded to the last paragraph in the article, which read, "But maybe, just maybe, it's a feature, giving you a choice about whether or not to copy and paste revisions. But if that's true, why not copy revisions when tracking is on, and *not* copy revisions when tracking is off? That would be more logical. Shoot, maybe it is a bug. If so, now you know how to squash it."

Hilary wrote:

It's a feature. Lots of times I'm working along, and I want to pull something from the main document, which has tracking active, to the style sheet--and I want the final version of whatever-it-is, not any changes I may have made in it. That wouldn't be feasible with the apparently logical system. Keeping only the final version is the more likely choice, so it makes sense to have to do something to keep the tracking.

But it's a feature only in Word 2000+; in Word 97, there's a genuine bug: you can't copy tracking AT ALL. If you want to reproduce a passage with tracking intact, you have to bookmark it, then use Insert, File, Range (bookmark name) to put the bookmarked passage into a file that has tracking turned off. (If you want the whole file, you can simply Insert it without the Range bit.)

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

Several readers responded to my answer to Wallace Sagendorph's superscript problem in last week's newsletter, including Mary Eberle, Eric Fletcher, Shirley S. Ricks, and Iwan Thomas. Eric Fletcher wrote:

I bet I won't be the only one to let you know about a much easier method to solve Wallace Sagendorph's superscript problem!

I would just change one instance manually, then select and copy it. Then, in the F&R dialog, put "m3" in the Find what and "^c" in the Replace with. The caret c replaces each instance found with the content of the clipboard.

Of course, your two-step method works for the general case but I'd be a little hesitant to use it unless I was pretty sure the manuscript didn't include other constructions that would get messed up. For example, H2O would end up with a superscript 2 with your wildcard method. I once discovered (luckily just before press!) that the 2 in all instances of "V2 rocket" had inadvertently been changed to a superscript because of an earlier fix to km2.

I really like the "Highlight all items" feature of Word's Find dialog as a tool to easily check the total number of items about to be changed. If it looks a bit too high or I'm not sure, I tick it to cause all found items to be highlighted, drop out of the dialog, copy and then paste into a new Word document. This gives me a list of all found items that is easy to sort or review before committing to the replace. We've done several jobs where URLs and email addresses are sprinkled throughout the ms. I tag them with "URL text" character styles (displayed in purple during editing). Not only is it easier to see this way, but the "highlight all/copy/paste to new doc" procedure gives me a sortable list of all such items--always very handy for confirming currency of such items. I also use a similar method for pulling all citations for easier checking.

Many thanks to Hilary, Mary, Eric, Shirley, and Iwan for their excellent tips and comments.

_____________________________________________________

NEED HELP?

If you need help with Microsoft Word, there are actually lots of places to go. Some of the best include:

The Word-PC List:

http://listserv.liv.ac.uk/archives/word-pc.html

The McEdit list:

http://groups.yahoo.com/group/McEdit/

Microsoft's Word discussion groups:

http://www.microsoft.com/office/community/en-us/FlyoutOverview.mspx#13

(Look in the lower right of the page.)

The Word MVP site:

http://word.mvps.org/

Woody's Lounge:

http://www.wopr.com/cgi-bin/w3t/postlist.pl?Cat=&Board=wrd

But if you can't find what you need in those places, send your question here:

mailto:help [at symbol] editorium.com

I'll put your question in the newsletter to see if some astute reader knows the answer.

Pasting Tracked Revisions

One of the oddest things in Microsoft Word is its seeming inability to copy and paste text that includes tracked revisions. If you want to see what I'm talking about, try this:

1. Create a new document.

2. Type a few lines of text.

3. Turn on revision tracking. (Double-click the TRK box in the status bar so the TRK turns black. Yep, TRK stands for "tracking." At this point, the Reviewing toolbar should appear at the top of your Word window.)

4. Delete a few words here; add a few words there. You'll see your revisions in color, since they're tracked.

5. Copy some text that includes tracked revisions.

6. Create a new document.

7. Paste your text into the new document.

Hey, where are the tracked revisions? Well, they didn't get copied (and thus didn't get pasted). But what if you really need to copy them?

As usual, there's a trick.

Just turn *off* revision tracking *before* copying the revised text. (Double-click the TRK box in the status bar so the TRK turns gray.) Then, when you paste the text (into a document with tracking turned off), all of your revisions will be there.

Why do you suppose Microsoft made Word that way?

A bug? Could be.

But maybe, just maybe, it's a feature, giving you a choice about whether or not to copy and paste revisions. But if that's true, why not copy revisions when tracking is on, and *not* copy revisions when tracking is off? That would be more logical. Shoot, maybe it is a bug. If so, now you know how to squash it.

_________________________________________

READERS WRITE

After reading our last article, "Indexing with a Two-Column Concordance," Patrick LaCosse wrote:

Why bother going through the extra step of delimiting styled paragraphs with certain characters (i.e., "<>")? The style itself is sufficient. Here is an example to show what the logic might be:

Set d = ActiveDocument

Set a = Documents.Add

d.Activate

Selection.HomeKey Unit:=wdStory

With Selection.Find

.ClearFormatting

.Style = "Author" 'Change this to the style of your choice

.Text = "" 'Include specific text if you like

.Wrap = wdFindContinue

.Execute

While .Found

a.Range.InsertAfter Selection.Text

.Execute

Wend

End With

[Note: The simplicity of that macro is deceiving; it's an extremely useful tool. If you don't know how to use such macros, you can learn how here: http://lists.topica.com/lists/editorium/read/message.html?mid=1706922855.]

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

Wallace Sagendorph wrote:

Even after poring over your excellent "Advanced Find and Replace in Microsoft Word" article I still can't quite find an answer to my problem:

In a long scientific paper an author writes "m3" when in fact "m^3^" (where the 3 is in superscript) is intended. The editor says "OK, I will just find all instances of "m3" and replace them with "m^3^." Not so fast! Using the font menu in "find and replace" and changing the "replace" 3 in "m3" to superscript, the result is ^m3^--that is, the entire expression is superscripted. The editor can just enter 3 in "find" and a superscripted 3 in "replace," but that necessitates finding every 3 in what we said was a long document and replacing only those that are exponents of "m"--drudgery!

I'm sure there's a way to use "find and replace" to change m3 to m^3^, but I'm not quite sure what it is. When you have a moment, I and perhaps others of your readers would appreciate learning the secret.

I responded:

This requires what I call a two-step find and replace. The basic technique is outlined here:

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

In your case, search for "m3" and change it to something like "m3~"

Then search for "3~" and replace it with "3" formatted as superscript.

You can also do a wildcard search that will catch any such combinations:

Find What:

([a-z][0-9])

Replace With:

1~

Then:

Find What:

([0-9])~

Replace With (formatted as superscript):

1

[You can get "Advanced Find and Replace in Microsoft Word" here: http://www.editorium.com/ftp/advancedfind.zip.]

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

Yateendra Joshi wrote:

A useful way to cross-check whether the specified formatting is being correctly implemented--at least the spacing part of it--is to check the At value in Word's status bar [at the bottom of the Word window]. We use a table that gives the correct value for different "zones" or positions: for example, if the cursor is in a header, the status line should show At 6mm; if in a footer, At 269mm; if in the first line of text following a chapter title, At 45mm and so on. Any departure from these values is a signal to check top and bottom margins, line spacing, and Spacing Before / After.

Many thanks to Patrick, Wallace, and Yateendra for their excellent tips and questions.

_________________________________________

RESOURCES

Yateendra Joshi, who sent that last tip in Readers Write, above, is the author of a terrific book, "Communicating in Style." Editors, especially, will find the detailed explanations of seldom-discussed topics to be worth reading. And you can read a sample chapter (and learn more about the book) here:

http://www.teriin.org/pub/books/cs.htm

As the Web site says:

The handbook is a handy reference whenever you find yourself looking for answers to questions such as those listed below, which arise routinely in communicating technical information formally.

What should a list such as this use to mark off items: bullet points, numbers, or letters?

Where do you cite the source of unpublished data: within the document or at the end, under references?

Which font makes it easier to tell apart such similar-looking pairs of characters as a zero (0) and the letter 'o', the numeral one (1) and the letter 'ell' ('l')?

How are web pages cited when they are referred to in a document?

The main text consisting of explanations, suggestions, and descriptions is amply supported by 90 examples and nearly 150 quotes (from both printed sources and web pages) as well as references, figures, and useful resources (web sites, software, and templates). Separate chapters are devoted to different forms of text such as headings, lists of bullet points, abbreviations, tables, illustrations, references, presentations, posters, and punctuation. Useful annexes cover such matters as observing and using fonts, format for postal addresses and telephone numbers, and alternative spellings.

http://www.teriin.org/pub/books/cs.htm

Indexing with a Two-Column Concordance, Part 2

In last week's newsletter, I promised to show you the perfect example of when to use a double-column concordance in preparing an index, and an automatic way to create such a concordance. The perfect example is a poetry anthology, but almost any consistently structured compilation of articles or addresses will lend itself to this kind of indexing.

Let's say you've got that poetry anthology in front of you on the screen--"100 Poems to Brighten Your Day." As you look through the anthology, you notice a consistency in the way the poems are laid out:

Title

Author

Poem

For example:

Your Day

Jack M. Lyon

Roses are red;

Violets are blue;

This is a day

especially for you.

How inspiring!

And of course, the anthology was edited by an astute editor (probably you) who used paragraph styles for each text level:

Heading 1 (for the title)

Heading 2 (for the author)

Poem First Line (for the poem's first line)

Since this is a poetry anthology, you'll need to create at least three indexes:

Index of Titles

Index of Authors

Index of First Lines

Let's start with the titles. Since they've been styled as Heading 1, you can easily pull them out to put them in a concordance:

1. Click Edit > Replace.

2. Make sure your cursor is in the Find What box.

3. Click the More button if it's available.

4. Click the Format button.

5. Click Style.

6. Scroll down to Heading 1 and select it.

7. Click the OK button.

8. Move your cursor to the Replace With box.

9. Enter "<^&>" (without the quotation marks). That code in the middle of the angle brackets, ^&, is the "Find What Text" code, which you can learn more about here:

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

10. Click the Replace All button.

All of your poem titles should now be enclosed in angle brackets:

Now install my Puller program (use it free for 45 days), which makes it easy to pull delimited items into a separate document:

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

Use Puller to pull the items in angle brackets (the poem titles) into a separate file, which will look something like this:

Use Word's Replace feature to find "<" and replace it with nothing, then ">" and replace it with nothing, leaving just the list of titles:

Your Day

The Birds Are Singing

Sunshine and Lollipops

A Smile for You

Now put the titles into a table:

1. Click Edit > Select All.

2. Click Table > Convert > Text to Table.

3. In the dialog box, under "Separate text at," make sure "Paragraphs" is selected. Make sure "Number of columns" is set to 1.

4. Click the OK button.

Your titles will now be inside a single-column table. But this is supposed to be a double-column concordance. Why? You'll see. First, make it so:

1. Put your cursor inside the table.

2. Click Table > Select > Column.

3. Click Edit > Copy.

4. Put your cursor to the right of (and outside) the table's first row. (Just click there with your mouse and make sure nothing is selected. You should see just your regular, thin cursor to the right of the table's top row.)

5. Click Edit > Paste Columns.

There! Two columns! And you'll need two columns, because the second column tells Word how to index what's in the first column. For example, you're going to want to lose those initial articles:

The Birds Are Singing Birds Are Singing

A Smile for You Smile for You

Thus, in the finished index, the titles will look like this:

Birds Are Singing

Smile for You

Sunshine and Lollipops

Your Day

Here's an easy way to get rid of those initial articles:

1. Select the second column by putting your cursor into it and clicking Table > Select > Column.

2. Copy the column (Edit > Copy).

3. Create a new document (CTRL + N).

4. Paste the column into it (Edit > Paste).

5. Select the column in the new document.

6. Click Table > Convert > Table to Text.

7. Click the OK button.

8. For each article you want to get rid of ("The," "A," "An," and so on), search for a paragraph return followed by the article (^pThe ) and replace it with a carriage return (^p). This will miss an article on the first item in your list, so you'll need to remove that one by hand.

9. Select your edited list.

10. Convert the list back to a table.

11. Copy the single-column table.

12. Switch back to your document with the double-column concordance.

13. Select the second column.

14. Paste the edited column over the selected column.

15. Save your concordance with a name like "Title Concordance."

Next, you'll need to make a concordance of authors. Just follow the instructions above, searching for Heading 2 rather than heading 1. You'll end up with a double-column table that looks like this:

Jack M. Lyon Jack M. Lyon

Ima Happy Ima Happy

Sonny Day Sonny Day

What you really want, however, is a concordance that looks like this:

Jack M. Lyon Lyon, Jack M.

Ima Happy Happy, Ima

Sonny Day Day, Sonny

The easiest way to get one is to follow steps 1 through 7 in the instructions immediately above. That will give you a list of names, not in a table, and you can use my free NameSwapper macro to transpose the names with last name first:

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

To get your list of names back into the concordance, follow steps 9 through 14 above. Then save your concordance with a name like "Author Concordance."

You can repeat all of this for the index of first lines, although you may not need to change anything in that second column. Up to you!

When you're finished, create your index, using each concordance to automatically mark index entries:

1. Click Insert > Index and Tables > Index > AutoMark. (In Word 2002 and

later, click Insert > Reference > Index and Tables > Index > Mark

Entry.)

2. Navigate to your concordance file and click it to select it.

3. Click the Open button and wait while Word marks all of those index

entries.

4. Generate your index as explained here:

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

If you're doing a poetry anthology, you'll probably also need an index of topics. Unfortunately, there's no good way to automate that. Instead, you'll need to use your indexer's brain. But maybe the techniques explained in this article will help when you do have items that can be indexed automatically.

_________________________________________

READERS WRITE

Editing and Microsoft Word expert Geoff Hart wrote to suggest that I might want to make a further clarification about what a concordance is. When I say concordance, I'm not talking about a back-of-the-book index, such as an index of topics in a poetry anthology or an index of subjects in a textbook. In my opinion, such an index can be created only by a human mind. As Geoff wrote:

"An indexer examines each occurrence of a word and communicates why that occurrence is important by providing context. For example, 'Washington, George' (in a concordance) becomes "Washington, George--birth of, --death of, --election of" and so on in an index. Similarly, an indexer provides cross-references (e.g., President: see Washington), synonyms (Walstein: see Washington -- here, a fictitious example assuming that George Walstein changed his name to George Washington to make it more likely he'd be elected ), and so on. The index is clearly more useful, but is also enormously more difficult to create.

"I'm a half-decent indexer, but stand in awe of the real pros like Lori Lathrop, who provide an almost magical means of access to a large book. A concordance can help a professional indexer in their work, but it can't take the place of an index, and an amateur shouldn't even attempt this task without doing some study to learn how it's done. The Chicago Manual of Style provides a decent introduction to indexing."

In last week's newsletter, I mentioned two definitions for "concordance":

1. A list of all words in a document, to be used as an aid in editing.

2. A list of words used to create an index, as explained in today's article.

Geoff is suggesting one more definition:

3. A list of every word in a document and the *pages* on which that word appears.

This kind of concordance is most commonly seen in the back of certain editions of the Bible, making it possible for readers to look up any word used in the Bible and find the places in the text where that word is used. Again, let me emphasize that this is not the same as a back-of-the-book index. A concordance can be created by a computer; an index can be created only by a human mind.

Of course, the human mind can use a computer to *help* with the creation of an index, and I'm pleased to announce that the indexing program I've been working on for more than a year is nearly ready for release. I'll be making an "official" announcement and description of the program soon in this newsletter, so stay tuned. In the meantime, I'll just mention that the program is a Word add-in that allows you to select specific document text from *here* to *there*; press a key to create an empty row in a Word table in an accompanying document; type your index heading, subheading, cross-reference, and so on into the row; rinse and repeat until your index is finished; edit as needed; automatically embed Word index entries based on the table you've created; and finally generate the index and page numbers (locators), with the option to sort word by word or *letter by letter.* Index subheadings can also be sorted *by page.* You can see all of your entries at all times in the index table; no more indexing in the dark, and no more working directly with embedded commands. If you like, once the table has been created, you can import it into Cindex or other dedicated indexing programs for final processing, *without* having to type in page numbers. I've tried to build in plenty of power and flexibility for all. The program has many more features, and I'll be explaining what those are in the near future. *If you have suggestions* about what you'd like to see in the program, *please* let me know, and soon!

mailto:editor [at symbol] editorium.com

Many thanks to Geoff for his clarifying comments and for the opportunity to plug my forthcoming program.

_________________________________________

RESOURCES

I recently learned about DesignGeek, which is a newsletter sort of like Editorium Update but written for people who inhabit that alternative universe of designers! If you spend part (or all) of your time in that universe, you'll definitely want to check out DesignGeek, which offers the same kind of useful, gritty, real-life tips and instruction you enjoy (I hope) in Editorium Update:

http://senecadesign.com/tips-pubs/designgeek.html

The Web site says:

"DesignGeek is a free e-mail newsletter written by Anne-Marie 'HerGeekness' Concepcion, president of Seneca Design & Training. Coming at you every couple weeks or so, each issue contains about a page's worth of her newest finds: advanced tips, techniques, links, and late-breaking news for Mac and PC designers who use the world's coolest software: InDesign, QuarkXPress, Photoshop, Acrobat, Illustrator, GoLive, Dreamweaver and more.

As I started to explore this site, I was blown away by how much Anne-Marie knows that I don't. There's stuff here I've never even heard of. Pixel fonts? Cool! "HerGeekness" indeed! I'm going to be reading and learning here for a long time to come. Enjoy!

Indexing with a Two-Column Concordance

Recent articles in this newsletter have discussed editing with a concordance, which may be confusing for some readers. Let me explain. In those articles, "concordance" really means "word list." It's simply a list of all the words in a document, and it can come in pretty handy in editing.

Experienced Word users know, however, that a concordance is also a list of words used to create an index. You can learn more in my article here:

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

That article explains how to use a one-column concordance, but it's also possible to use a two-column concordance to create an index in a Word document. Why would that be useful? Because it tells Word to index certain words and phrases differently than they appear in the text.

Let's say your text includes a sentence like this:

"George Washington was the first president of the United States of America."

You can create a concordance entry that looks like this:

George Washington Washington, George

Then, when Word comes to the words "George Washington" in your document, it will create an index entry for "Washington, George." And it will do that for each instance of "George Washington" in your document.

To create a two-column concordance:

1. Create a new document (CTRL + N).

2. Click Table > Insert > Table.

3. Under "Number of columns," enter 2.

4. Under "Number of rows," enter 1.

5. Click the OK button to create your table.

6. In the table, enter your first term and its replacement. For example, in the first column you could enter "George Washington," and in the second column you could enter "Washington, George." (Don't include the quotation marks.)

7. Press the Tab key to create a new row.

8. Enter more terms and replacements and rows as needed.

9. Save your concordance.

When you're finished, create your index:

1. Switch to your document.

2. Click Insert > Index and Tables > Index > AutoMark. (In Word 2002 and later, click Insert > Reference > Index and Tables > Index > Mark Entry.)

3. Navigate to your concordance file and click it to select it.

4. Click the Open button and wait while Word marks all of those index entries.

5. Generate your index as explained here:

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

If you're a professional indexer, you probably avoid indexing in this way, although Steve Hudson's Indexer program can help a lot with creating embedded indexes in Word:

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

Next week, however, I'll show you the perfect example of when to use a double-column concordance in preparing an index--and an automatic way to create it.

Thanks to Mark Taylor for suggesting this article.

_________________________________________

READERS WRITE

Mark Taylor wrote:

"Using a concordance table allows you to index using an 'alias.' A table also allows you to index multiple instances of a word, regardless of capitalization. For example, you could find Delaware and DELAWARE in the same document, but both would be a separate entry because the concordance is case sensitive. Using a concordance table gives you a simple workaround to this problem. You could force the index to have both entries found under the heading Delaware, or under DELAWARE."

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

Last week's newsletter included a macro to count revised words in a Word document:

http://lists.topica.com/lists/editorium/read/message.html?mid=1717164663 (scroll down to the Readers Write column)

After looking through the macro (which included the line "For r = 1 To RevCount"), Wallace Sagendorph wrote, "What does that 'r' stand for, anyway?"

I responded:

It doesn't really stand for anything. It's just an incremental counter. Here's how it works:

RevCount = ActiveDocument.Revisions.Count

That counts the number of revisions in the active document and stores the count in a variable named RevCount. (Remember X in algebra? That's all a variable is; it's a placeholder for some number.)

Then we have this:

For r = 1 To RevCount

(Something happens here)

Next r

That says to Word, "Starting with the number 1, do (something) however many times RevCount is."

"Next r" just increments r by 1.

So, let's say RevCount = 3, and the (something) was "Insert 'hello' into my document." The macro would insert this:

hello

Then it would make r become 2 instead of 1 (Next r).

Then it would insert this:

hello

Then it would make r become 3 instead of 2 (Next r).

Then it would insert this:

hello

When r got to 4, the macro would stop, because 4 is one more than Revcount (3), and you'd have something like this in your document:

hello

hello

hello

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

Paul Robinson wrote:

"I've just got your update. It reminded me that I've been meaning to get in touch to thank you properly for the revisions-counting macro. I'm very grateful for your help.

"The macro takes a bit of getting used to. I find it takes an awfully long time to count the revisions in 5-10,000-word documents. In fact, so long, that at first I thought it wasn't working--one really should go and make a cup of tea and leave the computer to itself! This might be worth mentioning in the update."

I responded, "Yes, and I don't have a way around this--other than get a faster computer. 🙂 I've made the macro as efficient as I know how."

If you, gentle reader, know how to speed this up, I'd love to hear from you.

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

Bill Rubidge wrote:

It's a funny coincidence about your macro to count revisions. I have been tinkering with this a little myself, and had put together the following macro. It hasn't been optimized at all, in part because I'm still thinking about how to use it to quantify the degree of revision.

For example, I would consider replacing one word with another, in the same position, to be a very minor revision. A letter change within a word (colour to color) even more minor. But if a revision is long enough (X characters) to indicate a new sentence, that would be an indicator to my client that I had done more work.

The one weakness of the word revisions tracking tool is that it does not allow us to track a different kind of revision--where text is simply moved from one place to another in a document. (DeltaView from WorkShare can do this for you, but the license is designed for large organizations, so the tool is typically used by law firms. And I don't know whether that "moved" information would be accessible as a count, or through VBA.)

Anyway, as a work in process, here's my draft macro.

[If you don't know how to use such macros, you can learn how here:

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


Sub CountRevs()
Dim intWordCount As Integer
intWordCount = ActiveDocument.Words.Count
Dim intRevCount As Integer
intRevCount = ActiveDocument.Revisions.Count
If intRevCount = 0 Then
MsgBox ("This document has no revisions.")
Exit Sub
End If
Dim intCounter As Integer
intCounter = 1
Dim intInsertionCount As Integer
intInsertionCount = 0
Dim intInsertionLongestLen As Integer
intInsertionLongestLen = 0
Dim intDeletionCount As Integer
intDeletionCount = 0
Dim intDeletionLongestLen As Integer
intDeletionLongestLen = 0
Dim intOtherRevCount As Integer
intOtherRevCount = 0
Do While intCounter < intRevCount + 1
If ActiveDocument.Revisions(intCounter).Type = _
wdRevisionInsert Then
intInsertionCount = intInsertionCount + 1
If Len(ActiveDocument.Revisions(intCounter).Range) > _
intInsertionLongestLen Then
intInsertionLongestLen = _
Len(ActiveDocument.Revisions(intCounter).Range)
End If
Else
If ActiveDocument.Revisions(intCounter).Type = _
wdRevisionDelete Then
intDeletionCount = intDeletionCount + 1
If Len(ActiveDocument.Revisions(intCounter).Range) > _
intDeletionLongestLen Then
intDeletionLongestLen = _
Len(ActiveDocument.Revisions(intCounter).Range)
End If
Else
intOtherRevCount = intOtherRevCount + 1
End If
End If
intCounter = intCounter + 1
Loop
MsgBox ("Results of Revision Inventory: " & vbCrLf & _
"- " & intWordCount & _
" total words in the document (simple count)." & _
vbCrLf & "- " & intInsertionCount & _
" insertions, and longest insertion has " & _
intInsertionLongestLen & " characters." & _
vbCrLf & "- " & intDeletionCount & _
" deletions, and longest deletion has " & _
intDeletionLongestLen & " characters." & _
vbCrLf & "- " & intOtherRevCount & _
" other revisions (might be formatting, etc.).")
End Sub

Many thanks to Mark, Wallace, Paul, and Bill for their terrific comments and help.

Fancy Sorting

Back in my WordPerfect days, I used to enjoy the program's ability to do all kinds of fancy sorting. Microsoft Word has never been able to duplicate that, but it can still do more than you might think.

Let's say you've got a list of names, like this:

Kit Carson

Annie Oakley

Buffalo Bill

You probably know that you can sort them by first name under Table > Sort. But what if you want to sort them by last name? Yes, it *is* possible. Here's how:

1. Select the list.

2. Click Table > Sort.

3. Click the Options button.

4. Under "Separate fields at," select "Other."

5. In the box next to "Other," type a space (indicating the space between first and last names).

6. Click the OK button to go back to the "Sort Text" dialog.

7. Under "Sort by," click the drop-down arrow and select "Word 2."

8. Under "Then by, click the drop-down arrow and select "Word 1."

9. Click the OK button.

Your list should now be sorted like this:

Buffalo Bill

Kit Carson

Annie Oakley

Pretty slick!

What if some of your names have more than three parts?

Samuel Langhorne Clemens

Simple. Sort by Word 3, then Word 2, and then Word 1. Word lets you sort by up to three words, in any order, as long as they're separated by the same character (such as a tab, comma, or space). It may not be Perfect, but it's probably better than you thought.

_________________________________________

READERS WRITE

After reading the articles on Editing by Concordance in the past couple of newsletters, Meg Cox wrote:

"This is great stuff!

"My plan is emerging here. (You can include this in the newsletter if you want, Jack, but I haven't tried it all yet. Either way, if you see any holes in this process, tell me).

"1) Run Word Counter and go through the concordance and MegaReplacer process to make obvious changes. This would have been wonderful for fixing British spellings in this project (nearing completion) and the previous one. Take note of items that look troublesome but that I'll need to decide about when I encounter them in context.

"2) Use my indexing software to construct my style sheet as I work through the book. (But begin by entering items from the concordance file that I know right off the bat need to be on the style sheet. I can create a tab-delimited file with the necessary items from the concordance and import it to save on typing or copying and pasting.) Using the indexing program is necessary because the concordance won't help me with items that are more than one word, and with the software I won't have to navigate to the right spot on the style sheet to compare new terms with earlier entries--the style sheet sorts itself in the top of the window as I enter terms at the bottom.

"3) Note already-checked terms by finding and replacing to add different formatting or highlighting that I can remove later. Here there will be two levels: For references, I should do this while I still have all chapters combined. Then I can separate the chapters and use the same process to indicate, for example, whether an organization with an acronym has appeared spelled out yet in the chapter, and whether a person has appeared yet with both first and last name in that chapter. In the case of end-of-chapter notes I would also somehow need to revisit the references and use the highlighting method to check for use of a full citation first time and short cite thereafter. I'll have to think about how to do that."

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

Paul Robinson wrote:

"I edit in Word. After finishing a document, I calculate percentage mark-up by comparing a word count of the original document with a word count of the marked-up document. But this tells me only how many words I've added. I'd really like to be able to see how many words I've deleted as well. Then I could measure the heaviness of the editing by looking at the extent of both inserted and deleted words.

"At present I count characters-with-spaces in the original text and then in the text with tracked changes. This gives me a very rough, comparative idea of the extent of the editing. To be able to count the number of inserted/deleted words (the revised words in total) would be a definite advance. To be able to count the inserted and deleted words separately would be even better! One could then report to a client as follows. "The editorial changes required were heavy (or light, as the case may be): insertions = m% of original word number, deletions = n% of original word number, which compares with my averages thus . . ." Moreover, one could suggest, if the number of deletions, say, was high, that the client was writing in a rather ponderous style; and so on--with all due tact, of course!"

Thinking that Paul has a great idea here, I created the following macro, which provides a count of both insertions and deletions. If you don't know how to use such a macro, you can learn how here:

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


Sub CountRevisedWords()
Dim RevCount, WordCount, RevType, InsertedWords, DeletedWords, r
RevCount = ActiveDocument.Revisions.Count
For r = 1 To RevCount
WordCount = ActiveDocument.Revisions.Item(r).Range.Words.Count
RevType = ActiveDocument.Revisions.Item(r).Type
If RevType = 1 Then InsertedWords = InsertedWords + WordCount
If RevType = 2 Then DeletedWords = DeletedWords + WordCount
Next r
MsgBox "Inserted words:" & Str(InsertedWords) & " Deleted words:" & Str(DeletedWords)
End Sub

Many thanks to Meg and Paul for their terrific comments.

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