Autotext Toolbar

Microsoft Word's AutoText feature provides an easy way to store and then reuse text, graphics, fields, tables, bookmarks, and other items. For example, this newsletter includes the same "Fine Print" section every week. All I have to do is save that text as an AutoText entry, and I can easily insert it in the newsletter without retyping, copying, or pasting. Think of AutoText as your boilerplate library.

You can create, delete, and work with AutoText entries by clicking Insert > AutoText > AutoText. But the AutoText toolbar gives you quick access to AutoText entries that you use a lot. Since I work in a publishing house, I'm thinking particularly of manuscript markup tags or typesetting codes, as explained here:

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

To display the AutoText toolbar, click View > Toolbars > AutoText. You can identify the toolbar among your many others by its wide button labeled "All Entries."

HD1Now, need to insert a Heading code? Click "All Entries" on the AutoText toolbar. Then click "Heading Tags." Then click "Heading 1" to insert the Heading 1 tag. What? You don't *have* an entry for "Heading Tags"? Let's fix that right now:

1. Create a paragraph style called "Heading Tags." Strange as it may seem, Word uses the style of the text you select as the group name for AutoText entries you create.

2. Type the text you want to store as an AutoText entry--HD1, for example.

3. Apply your new "Heading Tags" style to that text.

4. Select the text.

5. On the AutoText toolbar, click the "New" button.

6. Enter a name (at least five characters) for your AutoText entry--"Heading 1," in this case.

7. Click the "OK" button.

There, you've now got a "Heading Tags" group, and within that group you've got a listing for "Heading 1." Here's how to use them:

1. On the AutoText toolbar, click "All Entries."

2. Click "Heading Tags."

3. Click "Heading 1."

Presto! "HD1" appears in your document, formatted with the style you originally gave it. That's kind of neat, because it means you can make different text levels stand out by defining the style to use a specific font or color.

If you don't *want* your code to be formatted with a style, just format your text with the Normal style before creating your AutoText entry. Your entry will then appear under "Normal" when you click "All Entries" on the AutoText toolbar.

Think this might be useful? Good!

_________________________________________

RESOURCES

MicroType provides a free typographic ruler that you can download and print on transparent film. Then you can place it over printed copy to determine font sizes, line spacing, and rule weights.

http://www.microtype.com/typometer.html

Notes to Bibliography

I'm often faced with the task of creating a bibliography for a book I'm editing, but I hate typing in all those entries from scratch. Lazy fellow that I am, I've figured out an automated way to turn parenthetical notes into bibliography entries. It's longish, but it sure beats doing it by hand. You may need to modify the procedure a bit to fit your own needs. Still, this article will give you the general idea.

Let's say we've got a document full of parenthetical notes, like this one:

(Jack M. Lyon, Total Word Domination [PocketPCPress, 2001], 121.)

The first thing we need to do is get all the notes out of there so we can turn them into bibliography entries, like this:

Lyon, Jack M. Total Word Domination. PocketPCPress, 2001.

If you need to do this with lots of documents, you'll want to look at our Puller program:

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

If you only need to do this with a document or two, you can use this sneaky little method:

1. *Back up your documents* in case anything goes wrong. There, you've been warned.

2. Click Tools > Replace.

3. In the Find What box, enter this:

(*)

4. With your cursor still in the Find What box, click the No Formatting button to remove any formatting that may be applied to the box.

5. In the Replace With box, enter this:

^&

6. With your cursor still in the Replace With box, click the No Formatting button to remove any formatting that may be applied to the box.

7. Click the Format button (you may have to click the More button before it's available) and then Font.

8. Under Effects, put a check in the box of an effect you *know* is not in your document. Shadow should do nicely. You'll probably want to avoid using italic or bold, which probably *are* used in your document.

9. Click the OK button. The Replace With box should now be labeled as "Shadow."

10. Put a check in the Use Wildcards checkbox.

11. Click Replace All.

All of your parenthetical notes will now be shadowed. Isn't that exciting?

Now get rid of everything in your document that's not shadowed, leaving only the parenthetical notes:

1. Click Tools > Replace.

2. Clear any text from the Find What box.

3. Click the Format button and then Font.

4. Make sure the check in the box next to Shadow is *blank*--no checkmark, either black or gray.

6. Click the OK button. The Find What box should now be labeled as "Not Shadow."

7. Clear any text from the Replace With box.

8. With your cursor still in the Replace With box, click the No Formatting button to remove the formatting applied to the box.

9. Remove the check from the Use Wildcards checkbox.

10. Click "Replace All."

Wow, the only thing left in your document is a bunch of shadowed text in parentheses. You want each note to be followed by a carriage return, so if some of them aren't, you may need to put some in:

1. Click Tools > Replace.

2. With your cursor in the Find What box, click the No Formatting button to remove the formatting applied to the box.

3. In the Find What box, enter this:

)

4. In the Replace With box, enter this:

)^p

5. Click "Replace All."

Now you may need to get rid of double returns:

1. Click Tools > Replace.

2. In the Find What box, enter this:

^p^p

3. In the Replace With box, enter this:

^p

4. Click "Replace All."

If you think all of this is too much work, you really should check out our Puller program.

What's next? Well, for starters, let's get rid of our opening and closing parentheses:

1. Delete the parenthesis at the beginning of your first note and the end of your last note.

2. In the Find What box, enter this:

)^p(

3. In the Replace With box, enter this:

^p

4. Click "Replace All."

Now let's get those names transposed:

1. Click Tools > Replace.

2. With your cursor in the Find What box, click the No Formatting button to remove any formatting that may be applied to the box.

3. In the Find What box, enter this:

,( *))

4. In the Replace With box, enter this:

^t1

5. Put a check in the Use Wildcards checkbox.

6. Click "Replace All." There should now be a tab following each name in your document. Please note that if you've got "Jr.," "Sr.," "Ph.D.," and so on with some of those names, you'll need to get the tab *after* the suffixes and make sure your commas are right. Remember that you can use Find and Replace to help you with this.

7. Click Edit > Select All to select all the text in your document.

8. Click Table > Convert > Text to Table.

9. In the dialog box that appears, make sure "Number of columns" is set to 2 and "Separate text at" is set to Tabs.

10. Click the OK button. Your notes are now in two columns, with names in the first one and the bookish stuff in the second one.

11. Use your mouse to point at the top of the first column. A little black arrow should appear, pointing down.

12. Click the left mouse button to select the column.

13. Click Edit > Copy to copy the column.

14. Create a new blank document.

15. Click Edit > Paste. The name column should now be all by itself in the new document.

16. Put your cursor somewhere in column and click Table > Select > Table to select the column.

17. Click Table > Convert > Table to Text.

18. Under "Separate text with," select "Paragraph marks" and click the OK button. You've now got a list of names *not* in a table.

19. Download and install our free NameSwapper macro:

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

20. Run the macro to transpose all those names to last name first. Pretty slick, no? Don't go sorting names or deleting duplicates just yet.

21. You guessed it, click Edit > Select All to select all those transposed names.

22. Click Table > Convert > Text to Table.

23. In the dialog box that appears, make sure "Number of columns" is set to 1 and "Separate text at" is set to Paragraphs.

24. Click the OK button. Your names are now back in a column.

25. Put your cursor somewhere in the column and click Table > Select > Table to select it.

26. Click Edit > Copy to copy the column.

27. Switch back to your main document.

28. Use your mouse to point at the top of the first column. That little black arrow should appear again.

29. Click the left mouse button to select the column.

30. Click Edit > Paste Cells to replace the column with your new one full of nicely transposed names.

Wow, thirty steps! That may be a record. I sure hope I got them all right.

Now let's de-table-fy your notes:

1. Put your cursor somewhere in the table and click Table > Select > Table to select it.

2. Click Table > Convert > Table to Text.

3. Under "Separate text with," select "Other" and put some weird character in the little box. I like to use the tilde character (~), which you'll find on the upper left of your keyboard. Click the OK button to get rid of the table cells and hook your names back up with their notes.

Easy sledding from here, so I won't outline the rest of the steps in detail, but here's the basic procedure:

1. Remove the check from the Use Wildcards checkbox.

2. Find the tildes and replace them with nothing.

3. Find all occurrences of a space followed by an opening bracket ( [) and replace them with a period followed by a space (. ).

4. Get rid of the closing brackets and page numbers by doing a wildcard search for this (yes, this will work on a Macintosh)--

]*[^013]

--and replacing it with this (note the period):

.^p

5. Replace Shadow with Not Shadow.

6. Sort the notes alphabetically and get rid of duplicates, using the automated techniques explained here:

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

7. Go to the top of your document and type "Bibliography." You'll probably need to do some cleanup, but basically you're done. Now, wasn't that easier than typing all those entries by hand?

To learn more about searching with wildcards, download our free paper "Advanced Find and Replace in Microsoft Word":

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

_________________________________________

RESOURCES

Need more help automating bibliographies and notes? You may want to look at EndNote, a Microsoft Word add-in designed specifically for that purpose:

http://www.endnote.com/enhome.asp

Editing Notes and Text Side by Side

Many of the books I edit in Word are loaded with footnotes, and I've often wished I had a way to see notes and text at the same time while scrolling through them independently. Comes the dawn! It's easy:

1. Open your footnote-laden document.

2. Make sure you're looking at the document in Normal view (View > Normal.)

3. Open your document in a new window by clicking Window > New Window. You'll now have two instances of your document open. Any change you make in one will be reflected in the other, but you can scroll through them independently.

4. Arrange and size your two windows so they're displayed on your screen side by side. (If you have our Editor's ToolKit program, click Windows > Arrange Documents to do this automatically.)

5. In one of the windows (I like the one on the right) open the Notes pane so you can see your notes (View > Footnotes).

6. Use your mouse to grab the divider bar between the Notes pane and the body text. Drag the bar to within about half an inch of the top of your Word window. (If you go too far, the Notes pane will close.) Now most of that window will be taken up by your notes.

7. Use CTRL + SHIFT + F6 to jump back and forth between the two windows while scrolling independently through them to your heart's content.

Now you can see and edit your notes and text at the same time.

You can learn more about Editor's ToolKit here:

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

_________________________________________

RESOURCES

Literary Machine is one of the most interesting programs I've looked at in quite a while. If you need a way to store free-form notes and ideas, retrieve them at will, and compile them into a document, Literary Machine may be just what you're looking for:

http://www.literarymachine.com

This powerful program comes in two versions: 2000 and Pro. The 2000 version is free but lacks some of the Pro features, and at $20 the Pro version is a bargain. Both versions have a fairly steep learning curve, but I'd like to share some tips that may make things easier if you're interested in trying the program.

The basic element in Literary Machine is the Item, which is simply an independent text note. Literary Machine is designed to hold lots of these. When you're planning your novel and have a plot idea, you'll create a new Item and type your idea into it. When you have another idea, you'll create another Item and type away.

But how will you find your Items again after you've put them away? Before you put them away, you'll assign one or more Concepts to each Item. Concepts are represented by words in a window on the Literary Machine desktop. Drag a Concept word to an Item, and the Item will be associated with that Concept. Drag a Concept word to the desktop, and the Items associated with the Concept will be displayed as small note cards, which you can move around at will.

The idea of associating Concepts with Items is a little difficult to understand, because it's exactly the opposite of how we usually think. Ordinarily, we think of documents as being *under* a certain category. In Literary Machine, categories (Concepts) are *associated* with documents (Items).

Another idea that's a little difficult to grasp is that Concept words and Concepts aren't really the same thing. Here's why: Let's say you have a bunch of Items that discuss cats and a bunch of other Items that discuss canaries. These Items are categorized appropriately using the separate Concepts "cats" and "canaries." Now let's say you have a single Item that discusses the *interaction* of cats with canaries. Yes, you could file it under "cats" and you could also file it under "canaries." But what if that was the *only* Item you wanted to find among a whole bunch of Items on either cats or canaries? You'd have to create a "hybrid" Concept that contained *both* words, "cats" and "canaries," and assign the new Concept to that Item. Then, when you drop the Concept word "cats" or the Concept word "canaries" on the desktop, this "hybrid" Concept will appear along with the two separate Concepts. If you then drop one of the words (it doesn't matter which) from the hybrid Concept onto the desktop, you'll get *only* the Item that discusses both cats *and* canaries. In other words, a hybrid Concept is a way to file and retrieve an Item by combining Concept words. In computer language, it's an "AND." I want to find *only* the Items that are filed under "cats" AND "canaries." The separate Concepts would find the Items filed under "cats" OR "canaries." Remember, though, that you have to *assign* the hybrid Concept to the Items you want to retrieve rather than just dropping the two separate Concept words on the desktop.

Once you've got the Items in the order you want, how can you save them in that order? That's where Projects come in. You create a Project and add your selected Items to it. Then, by dropping the Project on the desktop, you'll display the same *Items* in the same *order* that you had before. You can export a Project, or multiple Projects (think "chapters"), as a separate file (think "book"). You can arrange Projects hierarchically as folders and subfolders, and if you export a group of Projects as an HTML file, the file will include the Project names as Word Heading paragraph styles.

There's one more way to find stored Items--by using the Find function, just as you would in Microsoft Word or other programs. The Items or Concepts containing the search word will be displayed on the desktop.

The program has many other terrific features, but they'll take time and thought to master. You'll probably find, however, that the result is worth the effort.

Another thing I like about Literary Machine is that its genius (literally) creator, Gunnar Sommestad, is open to suggestions about how the program should work, and he's constantly improving it. I, for one, am planning to support his efforts. In fact, I've created a macro that will convert Word documents to Items in Literary Machine. If you're interested in having the macro, let me know:

mailto:editor [at symbol] editorium.com

Microsoft's Font Properties Extension

If you work a lot with fonts, you'll probably be interested in Microsoft's Font Properties Extension, which will run under Windows 95 or higher (sorry, Mac users).

The extension makes it possible to display information about a font's origin, copyright, and licensing; its hinting and smoothing; whether or not the font can be embedded in a document; and perhaps most important, the font's character set.

Microsoft notes that the extension also "includes version and date information" and "describes the font in terms of number of glyphs, number of kerning pairs, the possible existence of a euro symbol, and the presence of embedded bitmaps within the font."

It's a useful tool, and best of all, it's free. You can learn more here:

http://www.microsoft.com/typography/property/property.htm

_________________________________________

READERS WRITE

John Renish wrote to say that the previous newsletter's macro to fix all caps in text didn't run. I offer my apologies and the corrected macro:

'THE MACRO STARTS HERE
Sub FixAllCapsInText()
'Macro created 10/26/2003 by Jack M. Lyon
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z]{2,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
Select Case Selection.Range
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
Selection.Range.Case = wdLowerCase
Case "Usa", "Nasa", "Usda", "Ibm", "Nato"
Selection.Range.Case = wdUpperCase
End Select
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.Execute
Wend
MsgBox "Finished!", , "Fix All Caps in Text"
End Sub
'THE MACRO ENDS HERE

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

For more information, see our previous newsletter:

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

Thanks, John.

_________________________________________

RESOURCES

Microsoft's Disagreeably Facetious Type Glossary is hopelessly old-fashioned, unabashedly British, and a delight to read, and it will reveal the meaning of typography terms that you never even knew existed.

http://www.microsoft.com/typography/glossary/content.htm

Fixing All Caps in Text

The newsletter a couple of weeks ago featured a macro that would set all headings in a Word document in true title case, with articles and prepositions lowercased. But what if you have a document in which an author has typed other stuff in all caps--author names in footnotes, or book titles in body text? It would be nice to have a macro that would look for anything in all caps and turn it to title case. I've modified the macro to do just that:

'THE MACRO STARTS HERE
Sub FixAllCapsInText()
'Macro created 10/19/2003 by Jack M. Lyon
Selection.Find.ClearFormatting
With Selection.Find
.Text = "[A-Z]{2,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
Select Case Selection.Range
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
wrd.Case = wdLowerCase
Case "Usa", "Nasa", "Usda", "Ibm", "Nato"
wrd.Case = wdUpperCase
End Select
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.Execute
Wend
MsgBox "Finished!", , "Fix All Caps in Text"
End Sub
'THE MACRO ENDS HERE

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

The key to the macro is this line:

.Text = "[A-Z]{2,}"

That tells Word to do a wildcard search for two or more capital letters in a row. If you like, you can make that number larger to avoid such common acronyms as USA and NASA. A better way to take care of such items, however, is to list them in the following line of the macro:

Case "Usa", "Nasa", "Usda", "Ibm", "Nato"

For more information, see the newsletter here:

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

And the Readers Write column in last week's newsletter here:

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

And if you'd like more information about wildcard searching, feel free to download my paper "Advanced Find and Replace in Microsoft Word":

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

Thanks to Linda Northrup for suggesting this topic.

_________________________________________

READERS WRITE

Jim Pinkham pointed out that the modified macro in last week's Readers Write column had a mistake on one line:

wrd.Case = wdUpperCase End Select

That should actually be two lines, like this:

wrd.Case = wdUpperCase

End Select

If you had trouble running the macro, that's why.

Johanna Murphy wrote:

"The Title Case Headings Macro is awesome! Although I would need one where you only change one level at a time. Also, I have created other styles which are named OUT and OUTNUMBER (with only 5 levels) that we use a lot in our law firm. How can I change the macro to specify those style names?"

I responded:

To use different styles with the macro, do this:

1. Delete these two lines:

For h = 1 To 9

Next h

2. Modify this line--

myHeading$ = "Heading" + Str(h)

--to something like this:

myHeading$ = "MyStyle"

Last week William T. Buckley wrote, "This is not a huge issue, but it does come up once in a while, especially in limited-space conditions. How do I produce a circled-c 'circa' sign or symbol, not to be confused with a (c) copyright symbol?"

Clarke P Gerber responded, "I've checked several specialist texts (including Chicago Manual of Style; NY Times Manual of Style and Usage) and cannot find any authority for using a circled 'c' as an abbreviation for circa. My own regional bible--The Cambridge Australian English Style Guide--says the following: 'When spelled out in full circa is often italicised. When abbreviated as c. or ca. it is now usually set in roman.'"

Thanks to Jim, Johanna, and Clarke for their messages.

_________________________________________

RESOURCES

The Microsoft Office Assistance page has a wealth of resources for Word users, including tips, templates, demos, and quizzes:

http://office.microsoft.com/assistance/

Page Down in Synch

Working on an index this week, I needed to ensure that pagination of the document I was indexing matched another document in which pagination had already been set. Because of the complexity of the material, I had to do this manually and visually, paging down in document 1, switching to document 2, paging down again, and then switching back to document 1. What a pain! It wasn't long before I found myself writing a macro to move down a page in both documents at once. Here it is, short but sweet:

'THE MACRO STARTS HERE
Sub PageDownInSynch()
Documents(2).Activate
Selection.GoTo What:=wdGoToPage
Documents(1).Activate
Selection.GoTo What:=wdGoToPage
End Sub
'THE MACRO ENDS HERE

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

For the macro to work, you must have two documents open in Word at the same time, and the process works best if you've sized and arranged the two documents vertically side by side. (Our Editor's ToolKit program includes an "Arrange Documents" macro that will do that for you instantly and automatically.)

For best results, assign the macro to a keyboard combination so you can quickly run it over and over with the touch of a key. You can learn how to do that here:

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

Now you can page through your documents, adjusting pagination as needed with manual page breaks (CTRL + ENTER). You'll probably find other uses for the macro as well. Enjoy!

_________________________________________

READERS WRITE

William T. Buckley wrote, "This is not a huge issue, but it does come up once in a while, especially in limited-space conditions. How do I produce a circled-c 'circa' sign or symbol, not to be confused with a (c) copyright symbol? I've looked at several grids and character maps, and don't find anything like what I need."

I was unable to find such a character, even in Unicode fonts. Do you, gentle reader, have an answer?

Preston Earle wrote, "Thanks for the improved Title Case macro. Is there a way to modify the macro such that it ignores a list of all-caps words like USA, NASA, MS (as in MS Word), and, perhaps, state abbreviations?"

I've now modified the macro to do this. Here's the new version:


'MACRO BEGINS HERE
Sub TitleCaseHeadings()
'Created by Jack M. Lyon
'
For h = 1 To 9
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
myHeading$ = "Heading" + Str(h)
Selection.Find.Style = ActiveDocument.Styles(myHeading$)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
For Each wrd In Selection.Range.Words
Select Case Trim(wrd)
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
wrd.Case = wdLowerCase
Case "Usa", "Nasa", "Usda", "Ibm", "Nato"
wrd.Case = wdUpperCase   End Select
Next wrd
wrdCount = Selection.Range.Words.Count
Selection.Range.Words(1).Case = wdTitleWord
Selection.Range.Words(wrdCount - 1).Case = wdTitleWord
strLength = Selection.Range.Characters.Count
For i = 1 To strLength
If Selection.Range.Characters(i) = ":" Then
Selection.Range.Characters(i + 2).Case = wdTitleWord
End If
Next i
Selection.Find.Execute
Wend
Next h
MsgBox "Finished!", , "Title Case Headings"
End Sub
'MACRO ENDS HERE

The line that makes the difference is this one:


Case "Usa", "Nasa", "Usda", "Ibm", "Nato"

Feel free to modify that line to suit your needs. The items I've included are just examples. Notice, though, that for the macro to work, you must type your items not in all caps (USA) but in title case (Usa). That's because the macro has already put the whole *line* in title case, so you're now specifying words in title case that you want to be in all caps.

Many thanks for the help, questions, and suggestions.

_________________________________________

RESOURCES

SoftSnow offers some very interesting software that may come in handy if you're involved in electronic publishing or converting documents to HTML. Book Proofer and HTML Book Fixer look especially interesting:

http://www.softsnow.biz/index.shtml

Title Case Macro, Version 2

Last week's newsletter featured a macro to change all-cap headings into title case. It had some drawbacks, though. It would do only one heading level at a time, and you had to specify which heading level you wanted it to work on. In addition, it didn't lowercase articles, prepositions, and conjunctions. What's really needed is a macro that will cycle through *all* of your heading levels (any paragraph styled with one of Word's Heading paragraph styles, such as Heading 1), make them title case, and lowercase articles, prepositions, and conjunctions unless they occur at the beginning or end of the heading. Oh, and one more thing: It should capitalize any word following a colon and a space. I'm giving away the store here, but here's the macro, which I hope you'll find useful:


'MACRO BEGINS HERE
Sub TitleCaseHeadings()
'Created by Jack M. Lyon
'http://www.editorium.com
For h = 1 To 9
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
myHeading$ = "Heading" + Str(h)
Selection.Find.Style = ActiveDocument.Styles(myHeading$)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
For Each wrd In Selection.Range.Words
Select Case Trim(wrd)
Case "A", "An", "As", "At", "And", "But", _
"By", "For", "From", "In", "Into", "Of", _
"On", "Or", "Over", "The", "Through", _
"To", "Under", "Unto", "With"
wrd.Case = wdLowerCase
End Select
Next wrd
wrdCount = Selection.Range.Words.Count
Selection.Range.Words(1).Case = wdTitleWord
Selection.Range.Words(wrdCount - 1).Case = wdTitleWord
strLength = Selection.Range.Characters.Count
For i = 1 To strLength
If Selection.Range.Characters(i) = ":" Then
Selection.Range.Characters(i + 2).Case = wdTitleWord
End If
Next i
Selection.Find.Execute
Wend
Next h
MsgBox "Finished!", , "Title Case Headings"
End Sub
'MACRO ENDS HERE

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

If you're wondering why you'd want to use a macro like that one, please see my article "The Case against Caps":

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

Please note that you can modify the macro to specify the words you want to be lowercased. Here are the lines you'll need to change:

Case "A", "An", "As", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With"

For example, if you wanted to add "Throughout," the modified lines might look like this:

Case "A", "An", "As", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With", "Throughout"

You can also delete words. For example, if you wanted to delete "As," the modified lines would look like this:

Case "A", "An", "At", "And", "But", _

"By", "For", "From", "In", "Into", "Of", _

"On", "Or", "Over", "The", "Through", _

"To", "Under", "Unto", "With"

Don't worry about getting the lines too long. You won't. The lowlines _ at the end of each line just break up the macro for easy reading. You can delete them and the following paragraph returns to merge the four lines if you want to.

By the way, you don't have to reserve the macro for changing headings in all caps. You can use it on any headings that need to be changed to true title case. This does not, however, excuse you from editing your headings.

Thanks to Hilary Powers for suggesting the improvements.

_________________________________________

READERS WRITE

Peg Wier wrote:

I agree with you on all counts about the formatting of headings with all caps. I think you left out the most important case against all caps--THEY ARE HARD TO READ!

Bruce White wrote about converting Word documents to HTML:

There are a whole bunch of tools that grew from WinHelp tools. Reworx grew out of HDK by Virtual Media. See the Republicorp website:

Instead of cleaning up Word HTML what you do is get the tool to generate the code from the Word document. It breaks the document into separate HTML pages based on the heading styles in the document. It will preserve the index entries, the links and especially the outline structure (levels of headings--which you can use it in a TOC if you want).

OR the pages can be passed to Dreamweaver and maintained there.

Many thanks for the help and suggestions.

_________________________________________

RESOURCES

Ever heard of a candrabindu? Want to know the difference between oblique and inclined? You can learn all kinds of interesting things from the Encyclopedia of Typography and Electronic Communication:

http://ourworld.compuserve.com/homepages/profirst/encycl2.htm#index

Title Case Macro

During my other life as a copyeditor, I often find myself needing to change the case of words that an author has typed in all caps, LIKE THIS, in chapter titles and subheads. I often perform the task with the handy Cap Title Case feature in my Editor's ToolKit program, but I've also wished for a macro that would do most of the dirty work automatically throughout a document without having to select text. So, I decided to write one. Here it is:


'MACRO BEGINS HERE
Sub FixCaps()
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Heading 1")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
While Selection.Find.Found = True
Selection.Range.Case = wdTitleWord
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.Find.Execute
Wend
MsgBox "Finished!", , "Fix Caps"
End Sub
'MACRO ENDS HERE

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

The macro goes through your document finding any words formatted with the Heading 1 paragraph style and changes them to title case. Of course, you'll still need to lowercase articles, prepositions, and conjunctions by hand, but at least the macro keeps you from having to change *everything* by hand.

If you're wondering why you'd want to change all caps to title case, please see my article "The Case against Caps":

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

Worried about all caps in other heading styles? You can modify the macro to find them by changing this line:

Selection.Find.Style = ActiveDocument.Styles("Heading 1")

For example, if I wanted to find text formatted with Heading 2 rather than Heading 1, I would change the line to this:

Selection.Find.Style = ActiveDocument.Styles("Heading 2")

You can also modify the case the macro will use to change the text it finds. Currently, it makes words title case, as specified in the following line:

Selection.Range.Case = wdTitleWord

Rather than using "wdTitleWord" (title case), however, you can use the following, if you prefer:

wdLowerCase (which formats the words in lower case).

wdTitleSentence (Which formats the words in sentence case).

Now the next time you need to change the case of a bunch of all-cap headings, you'll have an easy way to get the job done.

You can learn about Editor's ToolKit here:

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

_________________________________________

READERS WRITE

Last week Brad Hurley asked for help in cleaning up HTML from Word, and in particular copying the text of a Word document and pasting it into a Dreamweaver page while preserving basic text formatting (headings and any bold or italic body text) and hyperlinks that were created in the Word document.

Keith Soltys responded:

Your reader who wants to be able to get Word into Dreamweaver might want to take a look at the YAWC Pro plugin for Word:

http://www.yawcpro.com/

According to their web site:

"YAWC Pro generates HTML which is much cleaner and smaller than that generated by MS-Word itself. It also places the content of the Word document into a pre-defined HTML template, so that the output HTML is ready for immediate publication on a website. YAWC Pro avoids the need for post-conversion clean-up of HTML documents, and avoids the need for most content creators to have anything but the most basic knowledge of HTML."

It also can generate XML.

Looks like an interesting tool, but I haven't tried it so I can't offer an opinion on how successful it is.

As far as being able to just copy and paste into Dreamweaver, I don't think there's any way he's going to be able to do it without an intermediate conversion first.

Gaston Brisbois suggested using converters from Logictran:

http://www.logictran.net/products/

http://www.bykeyword.com/pages/detail7/download-7337.html

Cecelia Munzenmaier wrote:

Dreamweaver MX has an Import option that will automatically clean up Word HTML, as well as a separate "Clean Up Word HTML" command. If that's not heavy-duty enough, there's also Word Cleaner; I have no personal knowledge of it, but there's a description here:

http://www.wordcleaner.com/dreamweaver_details.htm

LeAnne Baird wrote:

I'd recommend looking at WebWorks Publisher for Word by Quadralay. With it you can map styles in Word to web styles and control how the formatting is changed on the web side. It's really slick once you get your their standard template customized for your look and feel.

You don't even have to cut and paste. Just run the WebWorks conversion utility on your file and you're done.

http://www.webworks.com/products/wwpp_w/default.aspx

Many thanks to all for their help and suggestions.

Visual Keyboard

Do you ever need to change your keyboard layout from one language to another? If so, you've undoubtedly noticed that your English-language keyboard doesn't always match the keyboard layout used by your computer. If this drives you crazy, you'll be happy to know about Microsoft's Visual Keyboard add-in for Word 2000 and 2002. Visual Keyboard displays the keyboard for another language on your screen so you can see the character you're going to get *before* pressing the key. You can learn more about Visual Keyboard (and download the free software) here:

http://tinyurl.com/rzle

And you can see a screen shot at Alan Wood's fabulous Unicode Resources site:

http://www.alanwood.net/unicode/utilities_fonts.html#visual

Once you've installed and activated the software, you can use Visual Keyboard by clicking its letters with your mouse. Or, you can simply use it as a visual reminder while typing on your regular keyboard. Pretty slick!

_________________________________________

READERS WRITE

Brad Hurley (bradhurley@sympatico.ca) wrote:

Although I still do a lot of editing for print publications, most of my work these days involves Web content. I edit documents in Word 2000 and pass them on to my company's Web designers, who primarily use Dreamweaver to make Web pages. I'm looking for ways to facilitate the transition from Word to Web. Saving a Word document as HTML isn't the solution, because Word famously inserts a lot of proprietary garbage into the code, and my clients want clean, standards-based HTML, formatted with external stylesheets instead of font tags.

There are Word-to-HTML tools in Dreamweaver and online (such as Textism's excellent HTML Cleaner: http://www.textism.com/resources/cleanwordhtml/), but if you want to generate text formatting that resembles what you had in your Word document, you have to first replace your custom styles with Word's standard styles. That can be tedious.

I want to be able to copy the text of a Word document and paste it into a Dreamweaver page, while preserving basic text formatting (headings, and any bold or italic body text) and hyperlinks that were created in the Word document. I wish we could bypass Word altogether and create content directly in Dreamweaver, letting my clients review and edit directly with content-editing tools such as Macromedia Contribute. But Contribute doesn't have Word's "track changes" feature, which is crucial to our document review process.

Any advice that you or your readers could provide would be appreciated!

So, gentle reader, do you have any advice for Brad? If so, please send it to me and I'll include it in the next newsletter. Thanks!

_________________________________________

RESOURCES

Aaron Shepard is making available a free article titled "Books, Typography, and Microsoft Word." The article explains how Word can be used to set type of a quality high enough to be used in desktop book publishing:

http://www.aaronshep.com/publishing

Aaron also offers an expanded version of the article in ebook form. One of the most interesting things about the ebook (which I bought) is the impressive quality of its typesetting, done in Word, of course. Check it out!

Thanks to Aaron for his valuable article.

Style Separator

Word 2002 and Word 2003 include a long-awaited feature: the Style Separator. The Style Separator is a special, hidden (and undocumented) paragraph mark. Rather than creating a paragraph *break,* however, it marks the spot where one paragraph style ends and another paragraph style begins--*all in the same paragraph.* That's right--starting with Word 2002, you can use two or more paragraph styles in the same paragraph.

Why should you care? Mainly because it gives you more control over what's included in a table of contents. Let's say you're editing a manuscript whose first chapter begins like this:

"Paris, City of Lights. After an excruciating ten-hour flight, I arrived at Charles de Gaulle International Airport, where my daughter was waiting with a large cardboard sign bearing the inscription 'Dad.'"

Since Word will create the table of contents from the Heading styles you've applied to your chapter headings (Insert > Reference [in Word 2002 and 2003] > Index and Tables > Table of Contents), you try applying the Heading 1 style to the paragraph. But that's no good, because you don't want the entire paragraph to show up in the table of contents. All you want is "Paris, City of Lights."

The workaround for this problem in earlier versions of Word was to break the paragraph in two:

"Paris, City of Lights."

"After an excruciating ten-hour flight, I arrived at Charles de Gaulle International Airport . . ."

Then, after applying the Heading style to the first paragraph, you would select its carriage return (paragraph mark) and format the return as Hidden text (Format > Font > Hidden). You might then have to insert a space to make everything look nice. And when you inserted the table of contents, sure enough, only the first bit would be included. Yes, you can still do that if you don't have Word 2002 or 2003.

If you do have Word 2002 or 2003, however, you can now use Word's built-in Style Separator instead of a hidden paragraph mark. First though, you'll have to drag it up from the storehouse of hidden Word commands and make it available on a menu, toolbar, or keyboard combination. You can learn how to do so here:

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

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

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

The name you're looking for on the Commands list is InsertStyleSeparator. Okay, I'll make it easy for you:

1. Click Tools > Customize.

2. Click the Commands tab.

3. In the Categories list, click All Commands.

4. In the Commands list, scroll down to InsertStyleSeparator.

5. Drag InsertStyleSeparator to the Formatting toolbar.

6. Click the Close button.

To actually use the Style Separator, you'll still have to start with the paragraph split in two:

"Paris, City of Lights."

"After an excruciating ten-hour flight from Dallas/Fort Worth International Airport . . ."

Then follow this procedure:

1. Place your cursor anywhere in the text of the first paragraph.

2. Create a Style Separator (which will be inserted at the *end* of the current paragraph and not at your cursor position) by using your new toolbar button, menu item, or keyboard combination. The two paragraphs will magically become one, with the Style Separator between the two.

3. Select the text before the Style Separator and style it with the Heading style you want to use in the table of contents.

When you generate your table of contents, the text before the Style Separator will show up there, but not the text after it.

By the way, you can actually see the Style Separator (it looks like a regular paragraph mark with a thin dotted line around it). To do so:

1. Click Tools > Options.

2. Click the View tab and put a checkmark in the All checkbox under Formatting Marks.

3. Click the OK button.

Note that if you open your Style Separator document in an earlier version of Word (97, for example), your Style Separators will become nothing more than hidden paragraph marks. Hmmm. Maybe the Style Separator isn't so revolutionary after all.

_________________________________________

READERS WRITE

A reader who prefers to remain anonymous sent a terrific tip for creating a printable list of document properties without opening the document:

I accidentally found an article on Microsoft's MVP Site called, "Using VBA, how can I get access to the Document Properties of a Word file without opening the document?" The link is:

http://www.mvps.org/word/FAQs/MacrosVBA/DSOFile.htm

This document has a link to a MS Knowledge Base article which has the DSOFile download. The article also has a link to a template to download and put in the Word Start Menu. When you do this it puts another option on the Tools menu to run the List File Properties. You then have to select which document properties you want to be listed. Bingo! The result is a table listing the document properties of each document in the folder. Actually, it only lists Word, Excel and PowerPoint documents. Fortunately for me, most of my documents are Word or Excel.

I have my document properties set up in the footnotes such as file name, subject, comments, author, etc. I wanted to keep an index of all documents so have manually entered the document properties for nearly 3,000 documents into an Excel spreadsheet. But now that I have the DSO file and template, I can run it to list the properties which I list in the spreadsheet and in the same order so that all I have to do is copy the table and paste it in the spreadsheet.

I keep all my new documents in the same folder until I have enough to put on disk. From now on, when I copy them to disk, I will run the properties list, paste it to the index, then either delete the documents or move them to another folder. That way, I will be sure that no document appears on the index more than once. The great thing about the Excel spreadsheet index is that I can sort by subject, or whatever.

This DSO file is going to save lots of time for me!

Many thanks for the great tip!

_________________________________________

RESOURCES

Inquisitor, from Word guru Steve Hudson, detects and reports corruption in Word documents. Here's Steve's description of the new program:

Inquisitor is a tiny tool for MS Word 97+ by the Word Heretic www.wordheretic.com. It uses two different methods to report on the levels of document corruption within the content of your document. Version 1 has no fancy graphics--it is a bare-bones report of the active document--but it is free.

The larger your document, the longer the report takes in a direct linear relationship. On a PIII machine the speeds are quite acceptable in that it is not worth getting up from your desk for reports on documents up to several hundred pages. Extensive advice for getting your code to run as fast can be found in the Word VBA Beginner's Spellbook from www.wordheretic.com.

When strange things start happening in your documents, or your sense of Word paranoia kicks in, click the button on the toolbar and you will have one of two reactions:

Oh, my document is not too corrupt; it must be something else. I'd better ask the Tech Whirlers for help:

http://www.raycomm.com/techwhirl/

Struth! Let's get started on some cleaning.

The actual cleaning of the document is left up to the user. The www.wordheretic.com site provides numerous goods and services for treating document corruption:

* The Word Spellbook has a manual cleansing procedure.

* The site offers a cleaning service for rapid, thorough cleansing of documents at the standard hourly rate.

* The site will offer an Enterprise edition tool to completely rebuild libraries of documents and templates.

Installation

Extract the template to a Word startup directory; full instructions are in the template if required.

For a limited time, the template is available from the Editorium. You can download it by clicking here:

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

Thanks to Steve for making this program available.