An American Editor

April 27, 2018

Lyonizing Word: Some Favorite Features from Editor’s ToolKit Plus 2018

Jack Lyon

Making new macros with powerful features!

Bright-colored icons for all happy creatures!

Searching for typos with fresh wildcard strings!

These are a few of my favorite things.

                      (Apologies to Rodgers and Hammerstein.)

The new Editor’s ToolKit Plus 2018 has a wealth of new features, but I’d like to alert you to a few of my favorites, some of which are not immediately obvious but can be enormously useful.

Title-case all headings

If I had to pick a favorite out of all the new features, it would be this one. The previous version of Editor’s ToolKit Plus made it possible to select a heading, press a key (or click the mouse), and properly title-case the selected text. For example, a heading like this one—

THE GHOST IN THE MACHINE

or this one (Word’s default)—

The Ghost In The Machine

instantly became capitalized like this—

The Ghost in the Machine

with commonly used articles, prepositions, and conjunctions lowercased. That was great as far as it went, but why not make it possible to properly title-case all of a document’s headings without having to select them? That’s what this new feature does, for any text formatted with a heading style (Heading 1, Heading 2, and so on—or your own custom heading styles).

But this feature takes things even a step further, allowing you to automatically title-case headings in the active document, all open documents, or all documents in a folder — your choice. Now, rather than painstakingly capping and lowercasing by hand, you can have this feature do it for you, in seconds rather than hours.

But wait — there’s more, as they say on TV. This feature references a list of words so it knows what to lowercase, and you can edit that list to fit your needs. Obviously you’re going to want such words as and, the, of, and an, but what about beyond? How about through? Add or remove words to meet your own editorial style.

In addition, you can add text that you want to remain in all caps: USA, NASA, AARP, and so on.

Finally, you can even specify mixed case, with words like QuarkXPress and InDesign.

In my opinion, this feature alone is worth the price of admission. It will save you many an hour of editorial drudgery.

AutoMaggie

As you almost certainly know from hard experience, sometimes Microsoft Word documents become corrupted. (The technical term for this is wonky.) The standard fix, known as a “Maggie” (for tech writer/editor Maggie Secara, who has made it widely known to colleagues, although she did not invent the technique), is to select all of a document’s text except for the final paragraph mark (which holds the corruption), copy the text, and paste the text into a new document, which should then be free of wonkiness.

That’s simple enough, but section breaks can also hold corruption, so if your document has several of those, you have to maggie each section separately. Paragraph breaks also can become corrupt, in which case they need to be replaced with shiny new ones. The AutoMaggie feature in Editor’s ToolKit Plus takes care of all this automatically.

MacroVault batch processing

If you’re fond of using macros that you’ve recorded yourself or captured online, you’ll find MacroVault a truly revolutionary feature of the new Editor’s ToolKit Plus 2018. It was included with the previous version of the program as a way to easily access the macros you use the most, including automatically set keyboard shortcuts to run those macros. Now it takes your macro use to the next level, allowing you to run any of your macros on the active document, all open documents, or all documents in a folder.

Not only that, but you can specify which parts of a document you want to use — the main text, text boxes, footnotes, endnotes, headers, footers, and comments. This brings enormous power and flexibility to your macro collection.

FileCleaner saved settings

FileCleaner has lots of new (and useful!) cleanup options — so many, in fact, that I’ve had to put each kind of option on its own tab, one for each of the following:

  • Breaks, Returns, Spaces, Tabs
  • Dashes
  • Hyphenation
  • Formatting
  • Text
  • Punctuation
  • Miscellaneous

But I think the slickest new feature in FileCleaner is the ability to save entire sets of options for future use.

Just enter a name for a set of options (for a certain client, a certain kind of manuscript, or whatever). Then click OK to clean up those options. The next time you use FileCleaner, you can activate that set of options again by clicking the drop-down arrow on the right. When you do, all of the options for that saved setting will become selected. You can save up to 20 different sets of options.

Speed!

My final favorite thing isn’t actually a feature. Instead, it’s the speed of nearly all the features in Editor’s ToolKit Plus 2018.

I originally wrote many of my programs back in the 1990s, using the clunky, old-fashioned WordBasic language. When Microsoft Word 97 was released, it featured a new language — VBA (Visual Basic for Applications), but it would also convert WordBasic macros into pseudo-VBA so the macros would continue to work in the new software. That pseudo-VBA has been the basis for my original programs ever since.

Now, in Editor’s ToolKit Plus 2018, I’ve rewritten most of the code from the ground up in native VBA. It took a long time to do that (nearly 28,000 lines of code!), but the resulting software is fast. NoteStripper, for example, used to strip notes to text by selecting, copying, and pasting each note. It worked, but if a document had lots of notes, it took a long time. Now, NoteStripper strips notes to text without selecting, copying, or pasting anything. Everything is done using the built-in text ranges of the notes and the document itself, and wow, what a difference!

For purposes of comparison, I just used NoteStripper on a document with 100 notes. The old version took 25 seconds — not bad. The new version took 2 seconds — making it more than 10 times faster than the old one. If you’re working on a big book with a short deadline, that kind of speed can make a real difference in your ability to get the job done.

In conclusion

I hope you’ll try the new Editor’s ToolKit Plus 2018 (which runs in Word 2016 on Macintosh, and in Word 2010, 2013, and 2016 on PCs), and that it will become one of your favorite things! If there are any features you particularly like, I’d love to hear what they are. If there are any features you would like to work differently, I’d love to hear about that as well.

Finally, if there are any features you think needed to be added, please let me know. I’d like to make Editor’s ToolKit Plus as useful as possible.

By the way, I continue to make improvements to the program almost daily. For that reason, if you’ve already installed Editor’s ToolKit Plus 2018, I strongly recommend that you download and install the most-recent version. You can download it here.

September 18, 2017

Lyonizing Word: Corruption

by Jack Lyon

Alas, poor Yorick! I knew him, Horatio, a fellow of infinite jest, of most excellent fancy. He hath borne me on his back a thousand times, and now, how abhorred in my imagination it is! My gorge rises at it. . . . Now get you to my lady’s chamber and tell her, let her paint an inch thick, to this favor she must come. Make her laugh at that.

Hamlet, act 5, scene 1.

Corruption is never funny, especially when you’re on deadline and the Word document you’ve been editing starts doing not-so-funny things, such as:

  • Repeatedly renumbering pages.
  • Repeatedly rebreaking pages.
  • Showing incorrect layout and formatting.
  • Showing strange or unreadable characters.
  • Producing error messages.
  • Omitting text that should be there.
  • Displaying text that shouldn’t be there.
  • Hanging your computer.

All of these are symptoms of document corruption, which is most often caused by one or more of the following:

  • Tracked changes in documents moved from PC to Macintosh or vice versa.
  • Master documents.
  • Nested tables.
  • Automatic list numbering.
  • Automatically updated document styles.
  • Fields, especially cross-references.
  • Deleted note reference numbers (in the notes themselves, not in the main text).
  • Saving when resources are low.
  • A corrupt printer driver (Word often crashes when printing).
  • A corrupt document template, especially Normal.dotm.

Early word processors, such as WordPerfect, kept track of text and formatting as a clean, continuous string of characters and codes that looked like this:

WordPerfect Reveal Codes

When creating Word, Microsoft took a different approach, using numeric pointers to specify what was going on in a document. For example, characters 7 through 15 of paragraph 10 might be given the attribute of italic. (That’s not technically exact; I’m just trying to convey the general idea here.) The problem is, those pointers can — and sometimes do — get out of whack and end up pointing at the wrong thing. A typical Word document has thousands of these pointers, which are stored in paragraph breaks and section breaks. Pointers for the document as a whole are stored in its final paragraph break, and this is often where corruption occurs. The usual solution is to “maggie” the document (a process named for Margaret Secara from the TECHWR-L mailing list). Here’s how:

  1. Back up your document, so if something goes wrong, you’ll have something to go back to.
  2. Select all of the text in the document.
  3. Hold down SHIFT and press the left-arrow key to deselect the final paragraph mark.
  4. Copy the selected text.
  5. Create a new document.
  6. Paste the text into the new document.
  7. Use the new document rather than the old one.

That, however, may not be enough. If your document has section breaks, they too can hold corruption, which means you’ll need to maggie each section separately—selecting its text, deselecting the section break at the end, and copying and pasting the text into a new document, adding new section breaks as needed. If you have lots of sections, this will take lots of time.

A better solution might be to use a macro that will automatically maggie each section (including the final paragraph mark). Here is such a macro that I hope you’ll find useful when corruption strikes. Note that when using the macro, you should have open only one document — the one you want to maggie.

Sub AutoMaggie()

Dim s As Integer
Dim secType As Integer
Dim secCount As Integer
Dim myDoc As Document
Set myDoc = Documents(ActiveDocument.FullName)

Documents.Add DocumentType:=wdNewBlankDocument
Documents(myDoc).Activate

secCount = ActiveDocument.Sections.Count
For s = 1 To secCount - 1
    secType = ActiveDocument.Sections(s + 1).PageSetup.SectionStart
    ActiveDocument.Sections(s).Range.Select
    Selection.MoveEnd Unit:=wdCharacter, Count:=-1
    Selection.Copy
    ActiveWindow.Next.Activate
    Selection.Paste
    Selection.InsertBreak Type:=wdSectionBreakContinuous
    ActiveDocument.Sections(s + 1).PageSetup.SectionStart = secType
    myDoc.Activate
Next s

'Copy and paste final section
ActiveDocument.Sections(secCount).Range.Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.Copy
ActiveWindow.Next.Activate
Selection.Paste

End Sub

Now let’s look at the macro to see how it works.

Sub AutoMaggie()

That first line simply gives your macro (technically a subroutine, or “Sub”) a name, which can be anything you like.

Dim s As Integer
Dim secType As Integer
Dim secCount As Integer
Dim myDoc As Document

Those four lines set up (dimension) four arbitrarily named variables, which simply hold information. (If you remember high school algebra, you were always trying to solve for the variable X.) Here, s, secType,  and secCount are defined as integers (whole numbers); myDoc is defined as a document.

Set myDoc = Documents(ActiveDocument.FullName)

That line assigns the name of your soon-to-be-maggied document to the variable myDoc.

Documents.Add DocumentType:=wdNewBlankDocument
Documents(myDoc).Activate

Those two lines create a new blank document and switch back to your original document (whose name is stored in myDoc).

secCount = ActiveDocument.Sections.Count

Here, we count the number of sections in the active document (our original) and assign the number to the variable secCount.

Now the fun starts:

For s = 1 To secCount - 1

That tells word to do whatever comes next a certain number of times, starting with the number 1 and ending with one less than the number of sections in our document. Why one less? You’ll see in a minute.

secType = ActiveDocument.Sections(s + 1).PageSetup.SectionStart

Here we get the type (continuous, next, odd, or even) of the next section (“s + 1”) and store that information in the variable secType.

ActiveDocument.Sections(s).Range.Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.Copy

In those three lines, we select the text of the section specified by s: If s is 1, we select the first section; if 2, the second section; and so on. After selecting the section, we move the cursor one character to left so that we’re not selecting the section break (which could hold corruption). Finally, we copy our selection.

ActiveWindow.Next.Activate
Selection.Paste

Here, we switch to our new, clean document and paste the text that we copied from the section in our original document.

Selection.InsertBreak Type:=wdSectionBreakContinuous
ActiveDocument.Sections(s + 1).PageSetup.SectionStart = secType

Next, we insert a continuous section break. Oddly, the first line alone won’t do what we need, even if we specify the Type using the variable secType. We must add the second line, which needs an existing section break in order to work. It turns that break into whatever type we stored earlier in the variable secType. (It took a lot of experimenting to pin down this wretched fact.) Again, we have to add 1 to the section number (“s + 1”) because we’re inserting the breaks after the section text.

myDoc.Activate

Here, we switch back to our original document.

Next s

This is the line that has been incrementing the s variable that we specified earlier in the line “For s = 1 To secCount – 1”.

ActiveDocument.Sections(secCount).Range.Select
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.Copy
ActiveWindow.Next.Activate
Selection.Paste

We select the last section in our original document, move back one character, copy the text, move to our new document, and paste.

End Sub

Finally, we end the macro.

After running the macro, you’ll be left with your original document (unchanged) and a new, unnamed document that is identical to your original but without the corruption.

That’s it! There are ways to make this macro more elegant and efficient, but, to paraphrase Blaise Pascal, I would have written a shorter macro, but I did not have the time. Nevertheless, the macro works for me; the next time you encounter corruption, I hope it works for you.

________

How to Add a Macro to Word & to the QAT

Here’s how to put this macro (or any other) into Microsoft Word so it will be available when you need it:

  1. Copy the text of the macro, starting with the first “Sub” and ending with the last “Sub.”
  2. Click the “View” tab on Microsoft Word’s ribbon.
  3. Click the “Macros” button.
  4. Type a name for the macro in the “Macro name” box — probably the name used after the first “Sub.” For this macro, that’s “AutoMaggie.”
  5. Click the “Create” button.
  6. Delete the “Sub AutoMaggie” and “End Sub” lines that Word created in the macro window. The macro window should now be completely empty (unless you already have other macros in there).
  7. Paste the macro text at the current insertion point.
  8. Click “File,” then “Close and Return to Microsoft Word.”

To actually use the macro:

  1. Place your cursor at the beginning of the document.
  2. Click the “View” tab on Microsoft Word’s ribbon.
  3. Click the “Macros” button.
  4. Click the name of your macro to select it.
  5. Click the “Run” button. (If you wanted to delete the macro, you could press the “Delete” button instead.)

Here’s how to put the macro on Word’s QAT (Quick Access Toolbar):

  1. Locate the QAT (it’s probably on the top left of your screen either above or below Word’s Ribbon interface).
  2. Right-click the QAT.
  3. Click “Customize Quick Access Toolbar.”
  4. Under “Choose commands from:” click the dropdown list and select “Macros.”
  5. Find and select your macro in the list on the left.
  6. Click the “Add” button to add it to the QAT.
  7. Click the “OK” button to finish.

Jack Lyon (editor@editorium.com) owns and operates the Editorium, which provides macros and information to help editors and publishers do mundane tasks quickly and efficiently. He is the author of Microsoft Word for Publishing Professionals, Wildcard Cookbook for Microsoft Word, and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Blog at WordPress.com.

%d bloggers like this: