More Hidden Secrets

Last week we talked about using Hidden formatting to make sure a list sorts properly. But Hidden formatting is useful for other things as well.

Let's say you're editing a scholarly book with dozens of block quotations from old journals. The author has consistently misspelled several geographical and personal names, so you fire up our MegaReplacer program to find and replace them all in one fell swoop (or you get ready to do them one at a time, by hand).

But wait! Although you want to replace the *author's* misspellings, you *don't* want to replace the original misspellings in the block quotations. They need to be reproduced verbatim. And you certainly don't want to okay every replacement by hand in this, long, long book.

Hidden formatting to the rescue!

Being the astute editor that you are, you've already formatted the block quotations with a style--named Block, let's say. (If you're not using styles for formatting, I beg you to learn how *today.* It will save you enormous amounts of time.) All you need to do now is set formatting in the Block style to Hidden. Here's how:

1. Click the Format menu.

2. Click "Style."

3. In the Styles box, click "Block."

4. Click the Modify button.

5. Click the Format button.

6. Click "Font."

7. Check the box labeled "Hidden."

8. Click the OK button.

9. Click the next OK button.

10. Click the Close button.

Whoa! All of your block quotations will have disappeared--if you're not displaying hidden text. If you *are* displaying hidden text, hide it, like this:

1. Click the Tools menu.

2. Click "Options."

3. Uncheck the box labeled "Hidden text."

4. Click the OK button.

Now, with your block quotations hidden, you can find and replace the misspellings in the rest of your text. Pretty slick!

Once you're finished, don't forget to reset your block quotations so they're no longer hidden. To do so, follow the first procedure used above, but this time *uncheck* the box labeled "Hidden." All of your block quotations will reappear, with their misspellings gloriously intact.

Now there's a "hidden" secret worth knowing!

Hidden Articles

In our last newsletter, we talked about how to work with lists.

You can read the newsletter here:

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

I presented the following list of book titles, noting that I'd removed the initial "The" from The Old Man and the Sea and The Great Gatsby so they'd sort properly:

To Kill a Mockingbird

Jane Eyre

Old Man and the Sea

Great Gatsby

Moby Dick

A subscriber wrote to ask if there isn't a way to preserve the initial articles (like "The") but still sort correctly, mentioning that he'd had to delete opening quotation marks from items in a list so the items wouldn't be sorted to the top.

It would certainly be possible to write a macro that would take care of such items. Another approach, however, would be to format initial articles as Hidden. Let's say you're working with a list like this (notice the articles on the third and fourth items):

To Kill a Mockingbird

Jane Eyre

The Old Man and the Sea

The Great Gatsby

Moby Dick

You could use Microsoft Word's Find and Replace feature to find "The" (using Match Case) and replace it with "The" in Hidden format. In Word 97, 98, and 2000, you'd do it like this (the procedure is basically the same in earlier versions):

1. Click the "Edit" menu.

2. Click "Replace."

3. If it's available, click the "No Formatting" button.

4. Type "The " in the "Find what" box (include a space after the word).

5. Type "The " in the "Replace with" box (include a space after the word).

6. If it's available, click the "More" button.

7. Check the "Match case" box. (Uncheck any of the other boxes.)

8. Click the "Format" button.

9. Click "Font."

10. Check the "Hidden" box.

11. Click the "OK" button.

12. Click the "Replace All" button.

13. Click the "OK" button when Word tells you how many items it found and replaced.

14. Click the "Close" button.

You could repeat this for anything else you want to be ignored when you sort the list, such as "A," "An," quotation marks, and so on. (You could even record all of these together as a macro.)

Now sort your list (Table/Sort Text). When you're finished, it should look like this:

Great Gatsby

Jane Eyre

Moby Dick

Old Man and the Sea

To Kill a Mockingbird

But wait! We're not done yet. Now we'll get our articles (etc.) back by reversing the Find and Replace routine we used to hide them:

1. Click the "Tools" menu.

2. Click "Options."

3. Click the "View" tab.

4. Check the "Hidden text" box (under the "Formatting marks" heading).

5. Click the "OK" button (revealing the hidden text so it can be found).

6. Click the "Edit" menu.

7. Click "Replace."

8. If it's available, click the "No Formatting" button.

9. Type "The " in the "Find what" box (include a space after the word).

10. If it's available, click the "More" button.

11. Check the "Match case" box. (Uncheck any of the other boxes.)

12. Type "The " in the "Replace with" box (include a space after the word).

13. Click the "Format" button.

14. Click "Font."

15. Clear the "Hidden" box.

16. Click the "OK" button.

17. Click the "Replace all" button.

18. Click the "OK" button when Word tells you how many items it found and replaced.

19. Click the "Close" button.

Now your list will look like this, which is what you were after in the first place:

The Great Gatsby

Jane Eyre

Moby Dick

The Old Man and the Sea

To Kill a Mockingbird

Hidden text is useful for other things, too--but we'll talk about that another day.

Working with Lists

In my other life I work at a publishing house, so quite often I compile and edit lists of book titles, authors, type specs--all kinds of things. (I just finished putting together a list of nearly 1,400 book titles for a giant electronic publishing project.) A typical list looks like this:

To Kill a Mockingbird

Jane Eyre

Old Man and the Sea

Great Gatsby

Moby Dick

And so on. (You'll notice that I removed the initial "The" from The Old Man and the Sea and The Great Gatsby so they'll sort properly. You may also want to do this with "A" and "An" if you're sorting lists of books.)

BMW (before Microsoft Word) I used to sort such lists by hand. Now I sort them like this:

1. In Microsoft Word, select the paragraphs making up the list to be sorted.

2. Click the Table menu.

3. Click "Sort" or "Sort Text."

4. Under "Sort by," select "Paragraphs."

5. Under "Type," select "Text."

6. Select "Ascending."

7. Click "OK."

Wow, that works great! But wait a minute. I've got Great Gatsby in here three times! And Moby Dick twice! I wonder how many other duplicates I've got. Isn't there a way to delete them automatically?

In fact, there is. Just use this trusty macro, compliments of the Editorium:

FOR MICROSOFT WORD 6 OR 7 (95):

'THE MACRO STARTS HERE
StartOfDocument
ParaDown 1, 1
Para1$ = Selection$()
CharRight 1
While AtEndOfDocument() = 0
ParaDown 1, 1
Para2$ = Selection$()
If Para1$ = Para2$ Then
WW6_EditClear
Else
Para1$ = Para2$
CharRight 1
EndIf
Wend
'THE MACRO ENDS HERE


FOR MICROSOFT WORD 8 (97 OR 98) OR 9 (2000):

'THE MACRO STARTS HERE
Dim Para1$
Dim Para2$
WordBasic.StartOfDocument
WordBasic.ParaDown 1, 1
Para1$ = WordBasic.[Selection$]()
WordBasic.CharRight 1
While WordBasic.AtEndOfDocument() = 0
WordBasic.ParaDown 1, 1
Para2$ = WordBasic.[Selection$]()
If Para1$ = Para2$ Then
WordBasic.WW6_EditClear
Else
Para1$ = Para2$
WordBasic.CharRight 1
End If
Wend
'THE MACRO ENDS HERE

TO CREATE THE MACRO

1. Copy the appropriate macro from this newsletter.

2. Click the "Tools" menu at the top of your Word window.

3. Click "Macro."

4. In Word 97, 98, or 2000, click "Macros."

5. Make sure "Macros Available In" shows "Normal.dot."

6. Type a name for the macro in the "Macro Name" box--"DeleteDuplicates" should do nicely.

7. Click "Create."

8. Paste the macro at the current insertion point.

9. In Word 6 or 7, click "File," then "Close," then "Yes." In Word 97, 98, or 2000, click "File," then "Close and Return to Microsoft Word."

TO RUN THE MACRO:

1. *Back up your document* in case something doesn't work quite right.

2. Click the "Tools" menu at the top of your Word window.

3. Click "Macro."

4. In Word 97, 98, or 2000, click "Macros."

5. Make sure "Macros Available In" shows "Normal.dot."

6. Select the macro (probably "DeleteDuplicates") in the "Macro Name" box.

7. Click "Run."

No more duplicates! (If you still see what seem to be duplicates, check them carefully. One of the pair may be spelled slightly differently or have an invisible space preceding the carriage return.)

If you need other macros to make your life easier, you may be interested in our program add-ins at http://www.editorium.com. If you're editing, writing, or typesetting in Microsoft Word, they'll save you time. Couldn't you use more of it?

Print What?

Recently a Microsoft Word user asked me, "Is there an easy way to print the names and descriptions of the styles I'm using in my document?" Fortunately, there is. Here's the procedure:

1. Click the File menu.

2. Click "Print."

3. Click the "Print what" box at the lower left of the Print dialog box.

4. On the list of items you can print, click "Styles."

5. Click "OK."

Microsoft Word will print out a nicely formatted list (names and descriptions) of the styles you're using in that document.

If you try this, you'll notice that there are other items on the "Print what" list besides styles (and the document itself, of course). These include:

* AutoText entries. This will print your AutoText entries, including the AutoText name and the text itself.

* Comments (Annotations). This will print the comments in the document (including page number, reviewer's initials, and the text of the comment), which can be handy if you need to give a bunch of queries to an author or just want to review notes you've made to yourself.

* Document properties (Summary info). This will print the information in the document properties or summary info, such as title, subject, author, and so on.

* Key assignments. This will print the names, keyboard shortcuts, and descriptions of any custom key assignments you've made.

Print what? Almost anything you want.

_________________________________________

RESOURCES

If you've been to the grocery store recently, you may have noticed certain boxes of General Mills cereal with a CD-ROM attached. The CD-ROM is advertised as containing a computer game (mine has "Amazon Trail"). What's not so obvious is that the CD-ROM also includes the Merriam-Webster Dictionary, the Merriam-Webster Thesaurus, the American Concise Encyclopedia, and the New International Version of the Bible--a pretty nice electronic reference library that's yours for free (after you buy the cereal, of course). I'm not promoting General Mills here; I'm just passing on a discovery that I hope you can use.