Add-Ins from Microsoft

By Jack Lyon, the Editorium

I’ve created lots of Microsoft Word add-ins at the Editorium, but did you know that Microsoft also provides add-ins, many of them free? Here’s how to explore and use these add-ins right from within Microsoft Word.

  1. In the search bar at the top of your Word window, enter “add-in.” You’ll then see an option like this:

img

  1. Click “Insert an Add-in” (or just press your ENTER key). Doing so will open the Office Add-ins dialog. On my computer, it looks like this, showing the add-ins I’ve already installed:

img

  1. To explore more add-ins, click the “Store” link under “Office Add-ins.” You’ll be presented with a bunch of add-ins and a helpful list of categories to help you find what what you need:

img

Many of the add-ins are free to use. Those that aren’t say “Additional purchase may be required.”

To learn more about an add-in, click its logo or title. To add it to Word, click the Add button and follow any online prompts. The add-in will then show up on the Home tab of Word’s ribbon interface:

img

I hope you find an add-in that does exactly what you need. If you do, please let me know, and I’ll review it in a future issue of Editorium Update. Thank you!

Converting Fields to Regular Text (and Why That Matters)

By Jack Lyon, the Editorium

Microsoft Word documents often include fields that authors use to insert text that isn't really text: dates, page references, author names, and much more. If you're editing a document that includes text copied and pasted from a web page (quite frequent these days), the text probably includes hyperlink fields, perhaps in a nice shade of blue or purple. Other kinds of fields may be indistinguishable from regular text, but that doesn't mean they'll translate correctly for publication. Usually, all of those fields first need to be converted to regular text. There are several ways to do that.

From the keyboard

  1. Press CTRL + A to select all text.
  2. Press CTRL + 6 to convert fields to text.

Using macros

This macro does the same thing as the keyboard procedure above:

Sub ConvertFieldsToText()
    selection.WholeStory
    selection.Fields.Unlink
End Sub

This macro converts hyperlinks only:

Sub RemoveHyperlinks()
    Dim oField As Field
    For Each oField In ActiveDocument.Fields
        If oField.Type = wdFieldHyperlink Then
            oField.Unlink
        End If
    Next
    Set oField = Nothing
End Sub

To use the macros, follow the instructions here.

The really interesting line in that last macro is this one, which identifies the type of field we want to unlink:

If oField.Type = wdFieldHyperlink Then

The reason that's interesting is that we can specify a different type of field using any of the options listed here. Go ahead, be choosy!

Using Editor's ToolKit Plus

Editor's ToolKit Plus makes the conversion easy. Just click the "Text" button and then click "Convert hyperlinks to regular text." (This actually converts all fields to regular text.)

img

Deleting (rather than just converting) fields

If you want to actually delete the fields (not just convert them to text), Allen Wyatt provides a good solution here.

Mucho Macros

By Jack Lyon, the Editorium

You're probably already familiar with Paul Beverley's editing macros, but there are plenty of other places to find Microsoft Word macros that you might find useful. Here are some of the best:

  • Allen Wyatt's macros, with clear explanations of how they work. Be sure to sign up for his free WordTips newsletter while you're there.
  • Graham Mayor's huge collection of useful macros and free add-ins. While you're there, support the man with a donation. He definitely deserves it.
  • Better Solutions provides a ton of useful information about how to work better with Microsoft Word, including macros galore.
  • Want to get more technical? Check out InfoExtract.
  • The Word MVP Site has macros along with thorough instructions about how to program in VBA (Visual Basic for Applications), Word's macro language.
  • Shauna Kelly provides macros and tons of tips for using Word. (Sadly, Shauna is no longer with us. But her work lives on!)
  • DocTools has add-ins for sale, but they also offer lots of free macros and other helpful information.

Don't know how to use macros found online? See my article here.

Getting Help with Macros

By Jack Lyon, the Editorium

While messing about with macros, I sometimes find myself up against a problem for which I have no solution. Time to get some help!

My usual approach is to use Google to search for "microsoft word vba [whatever problem I'm having]".

That turns up lots of interesting stuff, but the best answers are usually found in just a handful of places:

All of those have "Search" bars of their own, so you can search directly within those places for what you need.

The most reliable answers in those forums are usually given by the ever-helpful Microsoft MVPs, past and present. In particular, watch for answers from these folks:

  • Suzanne S. Barnhill
  • Paul Edstein
  • Terry Farrell
  • John McGhie
  • Charles Kenyon
  • Greg Maxey
  • Graham Mayor

And don't forget to say "Thank you!"


Readers Write

After reading last week's article, "Writing Down the Chaos," which discussed writing with notecard-based software, Kirsten Janene-Nelson wrote:

I use Scrivener. You can organize by cards with their "Corkboard" feature as well as seamlessly switch to manuscript view. There's a bit of a learning curve, but it's pretty painless and they have several helpful videos. My favorite feature is that you can keep all the moving parts of what you're writing close at hand without their being in your face. It's a virtual writing desk plus bulletin board plus project binder—all in one.

It's $59 after 30 days' trial—not 30 calendar days from when you start, but 30 actual days that you use Scrivener, regardless of when you start. https://www.literatureandlatte.com/scrivener

Thanks to Kirsten for this information. If you're serious about writing, Scrivener may be the very program you need to produce your masterpiece.

How to Add a Macro to Word and Its QAT (Quick Access Toolbar)

Microsoft Word's macro features make it possible to turn Word into a lean, mean editing machine. You'll find lots of free editing macros online (see below for some excellent sources). But how can you add a macro to Microsoft Word so it will be available when you need it? Here's the procedure:

  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.”
  5. Click the “Create” button.
  6. Delete the “Sub” 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.)

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.

Listing Keyboard Shortcuts: Two Methods

By Jack Lyon, the Editorium

As useful as custom keyboard shortcuts may be in using Microsoft Word, it's sometimes difficult to remember which keys you've assigned to what function. Word itself includes one way to find out:

  1. Click File > Print.

  2. Under "Settings," select "Key Assignments: List of your custom shortcut keys":

    img

  3. Select the printer you want to use.

  4. Click the big "Print" button at the top left.

You'll get a document with entries that look something like this:

img

As useful as that might be, it's kind of a mess to read. Microsoft could have done a much better job of formatting.

As an alternative, you can list all of your custom keyboard shortcuts with this handy macro:

Sub ListKeyAssignments() 
Dim kbLoop As KeyBinding
Dim aTemp As template
For Each aTemp In Templates
    If LCase(aTemp.Name) = "Normal.dotm" Then 'You can also use the name of a different template here.
        CustomizationContext = aTemp
        For Each kbLoop In KeyBindings
            selection.InsertAfter kbLoop.Command & vbTab & kbLoop.KeyString & vbCr
            selection.Collapse Direction:=wdCollapseEnd
        Next kbLoop
    End If
Next aTemp
End Sub

You may already know how to add such macros to Word, but if not, here's how.

And you can learn here how to run it.

Now, create a new document and run the macro. You should get results like this in your new document:

img

Much easier to read, don't you think?

After you've created a list of your custom keyboard shortcuts, you can change them or create new ones.

I hope this helps you turn your computer into the lean, mean editing machine it was always meant to be.

Better word processing: The Chicago Manual of Style interview

The Chicago Manual of Style "Shop Talk" column recently noted:

"When it comes to word processing, CMOS users probably represent every level of expertise (or nonexpertise), but regardless of skill level, we all experience frustration at times when we don’t know how to accomplish a task on our computers. Often we do something the way we’ve always done it—the slow way—because it just seems too difficult or scary to try to automate it. Is there a cure?"

There is a cure, as I explain in my interview with CMOS "Shop Talk." I grew up as a book editor by following the Chicago Manual of Style, so it was a real thrill for me to do the interview. I hope you'll find it interesting and useful.

Best wishes,

Jack Lyon

Removing Spaces at the End of Table Cells

Authors do funny things. Sometimes these things are inadvertent; sometimes they’re the result of trying to “prettify” documents for publication. In either case, editors have to clean up what the authors have done.

One such problem is spaces at the ends of table cells. A table cell should end with the text it contains. If there are spaces after that text, they can cause alignment (and other) problems if they’re allowed to persist into typesetting.

It should be a simple matter to clean up the extraneous spaces: Search for a space followed by an end-of-cell marker and replace with just an end-of-cell marker. But what magic code can we use to find or replace an end-of-cell marker? As it turns out, there isn’t one. But we can still get rid of those spaces with a macro. Here it is, with comments about what’s going on (text following a single quotation mark is a “comment”, which is also in green for clarity):

The Macro

Sub CleanCellEndSpaces()
'Define variables (that is, containers for information)
 Dim aTable As Table
 Dim aCell As Cell
 Dim aRow As Row
 Dim aColumn As Column
 Dim aRange As Range 'A specific area of the document
 Dim aLen As Integer 'A number
 Dim LastChar As String 'A string of characters (text)
Dim Tracking As Boolean 'True or False
 Tracking = ActiveDocument.TrackRevisions 'Get setting of revision tracking
 ActiveDocument.TrackRevisions = False 'Turn off revision tracking
On Error Resume Next 'In case of tables with "vertically merged" cells
 'Cycle through tables, rows, and cells
For Each aTable In ActiveDocument.Tables
 For Each aRow In aTable.Rows
 For Each aCell In aRow.Cells
CheckAgain:
Set aRange = aCell.Range 'Set aRange variable to the contents of the current cell
 aRange.End = aRange.End – 1 'Don’t include the end-of-cell marker
 aLen = Len(aRange.Text) 'Get the length of the cell’s text
 aString = aRange.Text 'Assign the text to a variable
 LastChar = Right(aString, 1) 'Get the last character of the text
 If LastChar = " " Then 'If the last character is a space
aRange.Text = Left(aRange.Text, aLen – 1) 'Set the text to be itself minus the trailing space
 GoTo CheckAgain 'Go back and check for another space (there may be several)
End If
 Next aCell
 Next aRow
 Next aTable
ActiveDocument.TrackRevisions = Tracking 'Set revision tracking back to its original state

End Sub

The Explanation

Here’s how the macro works.

We start by “dimensioning” (defining) our variables, like this:

Dim aTable As Table

“aTable” is an arbitrary name; I just made it up. But that whole line tells Word that aTable will represent a table in our document. The other “Dim” statements follow suit, with “aCell” representing a table cell, “aRow” representing a table row, and so on.

These three lines deserve special attention:

Dim Tracking As Boolean
 Tracking = ActiveDocument.TrackRevisions
 ActiveDocument.TrackRevisions = False

Dimensioning the “Tracking” variable as Boolean tells Word that the variable will be either true or false; those are the only two values it can hold.

Next, we set “Tracking” to the value of ActiveDocument.TrackRevisions. If revision tracking is on, “Tracking” will be set to “True.” If revision tracking is off, “Tracking” will be set to “False.” We do that to remember the current setting for revision tracking, because the next line, “ActiveDocument.TrackRevisions = False” actually turns revision tracking off (we’ll reset it later). This is necessary because (1) tracking the deletion of those extraneous spaces isn’t needed, and (2) using revision tracking may send this macro into an endless loop as it keeps “finding” the character that it just deleted (but is still there as a tracked revision).

The next line —

On Error Resume Next

— needs to be there in case a table includes “merged” cells, which will cause an error when the macro runs. If that happens, the macro will skip to the next line, which means that tables with “merged” cells will be ignored. There may be a better way to deal with such tables, but I don’t know what it is.

After that line, things get really interesting:

For Each aTable In ActiveDocument.Tables

This tells Word to work on “Each” table in ActiveDocument.Tables. “What’s that?” you ask. Well, obviously “ActiveDocument” is the active document — the document that’s open in Word with our cursor moving around in it. (Other documents may be open but not active.) In the active document, there’s a collection of objects called “Tables” — which are, of course, the tables in the document.

And now, a brief digression: As far as macros are concerned, a Microsoft Word document is “simply” a collection of various objects, such as tables, headers, footers, footnotes, endnotes, paragraphs, words, and much, much more. All of these objects have certain “properties.” For example, a paragraph may have the property of FirstLineIndent set to “True” — in other words, its first line is indented. Objects can also contain other objects. For example, a table always contains at least one row and one column. So, in our macro, we have this:

For Each aRow In aTable.Rows

That tells Word to work on each row in the current table. Similarly, this —

For Each aCell In aRow.Cells

— tells Word to work on each cell in the current row.

Next, we’re going to set the range of text we want to use (that is, aRange) to be the current cell:

Set aRange = aCell.Range

Then we’ll reduce the end of that range by one character, so we don’t include the end-of-cell marker:

aRange.End = aRange.End – 1

And, using the Len command, we’ll find out the length (number of characters) included in the range’s text:

aLen = Len(aRange.Text)

Now let’s get that text by putting it into the variable called “aString”:

aString = aRange.Text

And we’ll use the Right command to find out the last character of the text string (that is, the first character on the right of the string):

LastChar = Right(aString, 1)

That looks a little complicated, but it’s actually fairly simple. Let’s say our text string is “Hi, Mom!” The “1” tells the Right command at which character to start counting (from the right of the string). In other words, LastChar is assigned the last character of the string, which in this case is an exclamation mark (“Hi, Mom!”).

But what if the last character is a space? That’s what we really we want to know. The next line will tell us if that’s the case:

If LastChar = " " Then

If the last character is a space, we need to get rid of it, which we can do like this:

aRange.Text = Left(aRange.Text, aLen – 1)

That line changes the text of our range to itself minus its last character (if the previous line identified its last character as a space). But what if there’s more than one space? We want to get rid of those spaces too! And that’s where the next line comes in:

GoTo CheckAgain

That sends the macro back to the “label” we’ve created at this line:

CheckAgain:

And the operation is repeated on the cell until no more spaces remain at the end of the cell.

All of the “Next” commands that follow repeat the whole operation for every cell in every row in every table of the active document. Powerful stuff!

Finally, the macro restores revision tracking to its original setting as stored in the “Tracking” variable:

ActiveDocument.TrackRevisions = Tracking

As they taught us in kindergarten, it’s good to clean up after yourself.

This article is a brief introduction to manipulating Word “objects” with macros. Future articles may explore more of those objects, along with their “properties” and “methods.” If that’s more than you want to know, you may still find the macros themselves to be useful.

How to Add 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 “CleanCellEndSpaces.”
  5. Click the “Create” button.
  6. Delete the “Sub [macro name]” 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 and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Programs from the Editorium

Have you checked out the Editorium's latest Microsoft Word add-ins to help with your work?

IndexLinker creates hyperlinks from index page numbers back to the text to which they refer. If you're creating ebooks or PDFs with indexes, you need this program.

BookMaker automates typesetting and page layout in Microsoft Word. Stop fighting with page breaks, headers, and footers. Let BookMaker do the heavy lifting.

LyXConverter converts Word documents into LyX documents.

And, of course, many other useful add-ins are available as well, including Editor's ToolKit Plus.

A Special Deal: Editor's Toolkit Ultimate!

Editor's ToolKit Ultimate combines three great products:

The three products work together to create a powerful editing package to take you through three separate stages of copyediting.

Communication Conference

Wondering how to launch or improve an editorial business, whether you offer writing, editing, proofreading, indexing or other related services? Come to “Be a Better Freelancer! (Re)Invent Your Business,” the ninth annual Communication Central conference for freelancers, September 26–27, 2014, in Rochester, NY, with an Editorial Bootcamp on September 28 at the same location.

Topics include launching your business, macros and other efficiency/productivity tools, working with MS Office, organization tips, a self-publishing roundtable, balancing freelancing and family life, resources, benefiting from social media, and more. Keynote speaker is Jake “Dr. Freelance” Poinier. Other speakers include Erin Brenner, Ally Machate, April Michelle Davis, Daniel Heuman, Katharine O’Moore-Klopf, Dick Margulis, Greg Ioannou, Geoff Hart, Jack Lyon, Laura Poole, Ben Davis, Amy Schneider, and Ruth E. Thaler-Carter.

Interested in Laura Poole’s editorial bootcamp? Info for the Editorial Bootcamp is included in the conference registration PDF. The Editorial Bootcamp may be taken without attending the conference.

You'll find more information here:

http://www.communication-central.com/

Questions? Contact Communication Central owner Ruth E. Thaler-Carter, at conference@communication-central.com or 585-248-0318.

Deleting Extraneous Carriage Returns in Footnotes and Endnotes

During my editing career, I’ve often run into problems with footnotes and endnotes in Microsoft Word. Many authors have no clue about how notes are meant to work, and Microsoft certainly hasn’t made it obvious. In fact, they’ve made it easy to mess notes up beyond repair.

One mistake authors make is to insert extraneous carriage returns before or after a note. Why? Because they don’t like the positioning of the note on the page, which they’re trying to make “pretty,” not understanding the problems that will cause in editing and typesetting.

You can try to remove the extraneous returns like this:

1. Click View > Draft.
2. Click References > Show Notes.

Your cursor should now be in the Notes pane.

3. Click Home > Replace.
4. In the “Find What” box, enter two paragraph codes:

^p^p

5. In the “Replace With” box, enter one paragraph code:

^p

 6. Click the “Replace All” button.

Word will replace some of the double returns, but not all of them. And if you try to delete some of the remaining returns, you’ll get an error message:

“This is not a valid action for footnotes.”

What’s going on there is that not all carriage returns are created equal. Some of the returns are “special” note returns, and the only way to delete them is to delete the note itself back in the text.

The solution? A macro, of course. But a macro with a twist. As we’ve seen, you can’t just find double returns and replace them with a single return (even in a macro). And trying to delete extra returns results in an error. So let’s use that error!

Before running the macro, you must be in Draft view, with your cursor at the top of the Notes pane. (How to get there is explained above.)

In the macro, you’ll see a couple of “comments,” which are explanations or instructions intended for the person reading the code. Comments are preceded by a single quotation mark, which tells the macro to ignore the rest of the text on that line. They are usually displayed in green. For example, the first comment in the macro reads:

'To clean returns in endnotes rather than footnotes,
'change "Footnotes" to "Endnotes" in the following line:

And now, here’s the macro:

Sub CleanReturnsInNotes()
'To clean returns in endnotes rather than footnotes,
'change "Footnotes" to "Endnotes" in the following line:
NoteCount = ActiveDocument.Footnotes.Count
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
  .Text = "^p^p"
  .Replacement.Text = ""
  .Forward = True
  .Wrap = wdFindContinue
  .Format = False
  .MatchCase = False
  .MatchWholeWord = False
  .MatchAllWordForms = False
  .MatchSoundsLike = False
  .MatchWildcards = False
End With
Selection.Find.Execute
On Error GoTo TrapTheError
While Selection.Find.Found
  Selection.MoveLeft
  'The following line may trigger an error!
  Selection.Delete
  Selection.Find.Execute
Wend
GoTo TheEnd
TrapTheError:
ErrorCount = ErrorCount + 1
Selection.MoveRight
Selection.Delete
If ErrorCount < NoteCount Then Resume Next
TheEnd:
End Sub

Let’s look at some of those lines.

NoteCount = ActiveDocument.Footnotes.Count

NoteCount is a variable; that is, it’s a container that can hold a numerical value—in this case, the number of footnotes in the document. We get that value with the VBA command ActiveDocument.Footnotes.Count.

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting

Just to be safe, these lines clear any formatting that might already be applied to the “Find What” and “Replace With” boxes in Word’s find and replace feature.

The following lines, from

With Selection.Find

down to

Selection.Find.Execute

simply find any instances of double paragraph returns. The replacement text is set to nothing, as we’re not trying to replace those returns with anything:

.Replacement.Text = ""

Instead, we’re going to try to delete the second return, which (unless the notes are really messed up) is a regular return rather than a special note return:

Selection.MoveRight
Selection.Delete

If it’s a special note return, then trying to delete it will cause an error, and the macro will execute this line—

On Error GoTo TrapTheError

—which sends the macro to this line:

TrapTheError:

Here’s what happens next:

ErrorCount = ErrorCount + 1

Using the variable ErrorCount, we count the number of errors, adding 1 each time we find one. (ErrorCount is initially empty, or zero.)

Selection.MoveRight
Selection.Delete

We move right and delete the next return.

If ErrorCount < NoteCount Then Resume Next

If the number of errors is less than the number of notes, we’re not through yet, as one of the remaining notes may still have a bad return next to it. So, we tell the macro to Resume operation at the next command after the error occurred. That command is:

Selection.Find.Execute

In other words, Word looks for the next occurrence of a double return. And this construction—

While Selection.Find.Found
Selection.MoveLeft
  'The following line may trigger an error!
  Selection.Delete
  Selection.Find.Execute
Wend

—ensures that it will keep looking as long as (While) double returns are found. (“Wend” is short for “While End”—it marks the end of the While construction.)

GoTo TheEnd

When no more double returns are found, this line is executed. It exists simply to avoid executing the error trap (TrapTheError: and the following lines) after the macro is finished, at which point

TheEnd:

marks the end of the whole operation.

I hope this explanation has helped you understand better how macros work, and in particular how you can actually use Word errors to force Word to do what you want it to do—something that gives me great pleasure.

Even if you don’t understand everything that’s going on in this macro, you can still use it to clean up extraneous returns in notes—something that should make your editorial life a little bit easier.

How to Add the Macro to Word and to the QAT (Quick Access Toolbar)

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 “CleanReturnsInNotes.”
  5. Click the “Create” button.
  6. Delete the “Sub [macro name]” 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 and of Macro Cookbook for Microsoft Word. Both books will help you learn more about macros and how to use them.

Programs from the Editorium

Have you checked out the Editorium's latest Microsoft Word add-ins to help with your work?

IndexLinker creates hyperlinks from index page numbers back to the text to which they refer. If you're creating ebooks or PDFs with indexes, you need this program.

BookMaker automates typesetting and page layout in Microsoft Word. Stop fighting with page breaks, headers, and footers. Let BookMaker do the heavy lifting.

LyXConverter converts Word documents into LyX documents.

And, of course, many other useful add-ins are available as well.

A Special Deal: Editor's Toolkit Ultimate!

Editor's ToolKit Ultimate combines three great products:

The three products work together to create a powerful editing package to take you through three separate stages of copyediting.

Button Bonanza

Stars, pencils, light bulbs, puppy dogs, faces, diamonds, and hearts. What am I talking about? Toolbar buttons! Lots and lots of toolbar buttons!

If you like assigning macros to toolbar buttons, you're probably tired of the paltry 42 images you can use on those buttons by default. But fear not! Word has hundreds of images available. You just have to know how to get to them. The only way I know is with a macro, and I'm perfectly happy to share it with you:


'MACRO FOR WORD 97 AND ABOVE STARTS HERE
Sub MAKEBUTTONS()
HowManyToolBars = 10
HowManyButtons = 150
first = 1
last = HowManyButtons
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
TbarName$ = "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10))
WordBasic.NewToolbar Name:=TbarName$, Context:=0
For button = first To last
WordBasic.AddButton TbarName$, 1, 1, "Bold", button, 0, ""
Next button
first = first + HowManyButtons
last = last + HowManyButtons
WordBasic.SizeToolbar TbarName$, 600
WordBasic.MoveToolbar TbarName$, 0, toolbar, (toolbar * 2) + 100
Next toolbar
GoTo Endmacro
Warning:
WordBasic.MsgBox "Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)) + " already exists.", "Delete Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

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

After you run it, you'll have 10 new toolbars, named Buttonbar 1, Buttonbar 2, and so on. Each toolbar will have 150 buttons. For the sake of programming simplicity, each button does the same thing: turn on bold formatting. But you can see a button's original function by resting your mouse pointer over it and waiting a few seconds for its tooltip to appear. You can also copy the images from any of the buttons to paste on any other buttons you want. For example, if you want to assign macros to custom toolbar buttons, you now have lots of button images to choose from. You can learn more about assigning macros to toolbar buttons here:

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

If you decide you no longer need the toolbars and their many buttons, you can delete them by running this macro:


'MACRO FOR WORD 97 AND ABOVE STARTS HERE
Sub DELETEBUTTONS()
HowManyToolBars = 10
On Error GoTo -1: On Error GoTo Warning
For toolbar = 10 To HowManyToolBars * 10 Step 10
WordBasic.ViewToolbars toolbar:="Buttonbar " + _
WordBasic.[LTrim$](Str(toolbar / 10)), Delete:=1
Next toolbar
GoTo Endmacro
Warning:
WordBasic.MsgBox "The toolbar does not exist.", "No Such Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

If you really want to go crazy, you can step up the "10" in this line to create more than 10 toolbars:

HowManyToolbars = 10

And you can step up the "150" in this line to create more than 150 buttons on each toolbar:

HowManyButtons = 150

If you want to play around with this, please be judicious. The higher you set those numbers, the longer it will take to create the toolbars and buttons, and the more unwieldy they will become. I think 150 is pretty manageable for the number of buttons on a toolbar. You can set this to, say, 500, but that makes a *big* toolbar. And how many toolbars do you really need? The highest I've gone is 30, but I think 10 is plenty. It would be interesting to know how many images are actually available. After a while, quite a few of the images will be blank, and many of them will be duplicates.

WARNING: Be sure to adjust the macro that *deletes* buttons to correspond with the macro that *makes* buttons. To be more specific, the line "HowManyToolbars" should be set to the same number in both macros. If you ignore this, you could end up deleting all those toolbars by hand (under View > Toolbars).

Here are the corresponding macros for Word 6 and 95, which have only 366 images altogether, so don't try to make the macro go any higher. If you do, you'll just get an error message. The name of the toolbar here is "Buttons."


'MACRO TO CREATE TOOLBAR IN WORD 6/95 BEGINS HERE

Sub MAIN On Error Goto Warning NewToolbar "Buttons" AddButton "Buttons", 1, 1, "Bold", 0 For button = 1 To 366 AddButton "Buttons", button, 1, "Bold", button Next button SizeToolbar "Buttons", 600 Goto Endmacro Warning: MsgBox "The toolbar already exists.", "Delete Toolbar" Endmacro: End Sub 'MACRO ENDS HERE


'MACRO TO DELETE TOOLBAR IN WORD 6/95 BEGINS HERE
Sub MAIN
On Error Goto Warning
ViewToolbars .Toolbar = "Buttons", .Delete
Goto Endmacro
Warning:
MsgBox "The toolbar does not exist.", "No Such Toolbar"
Endmacro:
End Sub
'MACRO ENDS HERE

Thanks to Frazer Wright for suggesting this topic.

_________________________________________

READERS WRITE

Responding to last week's article on setting Word 2002's tracking format, Keith Soltys wrote:

I was interested to note your macro for setting Word 2002 to mark deleted text as strikethrough. In versions of Word prior to 2002, I've usually set deleted text to be hidden. I was surprised to see that Word 2002 didn't allow you to change the option for this; I guess they really want you to use the balloons, a "feature" that I detest. (They also broke comments; there's a market for an addon to make Word 2002 comments work the same way that Word 2000 did).

However, I did run into a really interesting bug that you might not be aware of. If you are using Word 2000 and have your revision tracking options set so that revision tracking is on and deleted text is shown as hidden, this setting gets carried forward into your Word 2002 document. You can't change it through the interface, only through VBA.

In this case, and if you are not using balloons, you may run into pagination issues. What happens is that in print layout view, Word may insert spurious blank pages when it finds deleted text. Pagination will be OK in normal view, but in print layout you will get any number of blank pages added into your file. It gets even more interesting--if you go to print preview, your file may balloon in size to several thousand pages.

The conditions for this to happen are quite specific. You must have revision tracking set so that deleted text is marked as hidden and revision tracking must be set to Final Showing Markup, and you must be in Print Layout view and not using balloons.

The fix is to use VBA to change how Word shows deleted text from hidden to strikethrough. You can also accept the changes in the file. Or set revision tracking to Final, or use balloons.

I encountered this bug not long after "upgrading" to Word 2002. I posted a message about the problem to the word-pc list and was contacted by someone from Microsoft, who eventually confirmed that it was indeed a bug.

_______________

Adding to Rohn Solecki's technique (explained in last week's newsletter) of using formatting to emulate text on a green-screen computer monitor, Stephen Riley wrote:

I used to do something very similar "back in the day". Another great advantage is being able to cheat and edit the data you have captured.

It's sometimes a heck of a lot easier to do this than to setup meaningful data in whatever application you are documenting.

As an extra snippet this was when I was documenting green screen Unix apps. Screen capture was via a terminal emulator (Reflection?) running on a PC.

For report files, print to .txt file and ftp from server to PC. Similar Style definition tweaked for 132 chars and using a landscape page.

_______________

Mary Eberle sent in a question that some astute reader may be able to answer:

I have been using AutoCorrect in Word 97 a lot lately. I have two approaches to the item that replaces what I type: (1) unformatted and (2) formatted (i.e., including a word or phrase in italics, bold, or something like that).

I just bought a laptop and copied my Normal.dot file onto the laptop. The "formatted" items in the AutoCorrect list copied, but the "unformatted" items did not. Do you know how to make the "unformatted" ones copy as well?

Mary also provided the following tip:

The reason I've been using AutoCorrect so much is that I've found a way to simplify my editing considerably. For example, if the author has used the verb "is" but the verb should be "are," I have an AutoCorrect entry that changes "isz_" (where the _ represents a space--the trigger for AutoCorrect to make the change) to "are"; I place the cursor right after the "is" and then access the AutoCorrect feature with a function key that types "z space backspace" and the "is" toggles to "are." By using the same function key I can toggle "are" back to "is" ("arez" becomes "is"). I have set up numerous such pairs in my original AutoCorrect file. I used "z" because in English it doesn't form many words at the end of a word; if one just uses a space, AutoCorrect jumps in to "help" when it is not wanted.

You may wonder how I'm using a function key to accomplish the "z" thing. Well, I was actually using a key on my programmable X-keys keyboard.

One reason the z_space approach and the X-keys are helping me speed up my editing is that I don't have to take my right hand off the mouse, so I can quickly move to the next thing that needs to be fixed.

Further information: Just typing "z" and then "space" will invoke the "isz to are" or "arez to is" toggle. No backspace or macro is needed. I've been using the programmable X-keys for so long now that I'm not used to just using the regular keyboard. Anyway, I hope that this toggle idea is useful to you.

_______________

Susan Bullowa asked the following questions. Any takers?

1. On rare occasions that I cannot seem to reproduce on my own, a screen tip appears when my cursor hovers over a paragraph (not the same as pressing SHIFT+ F1). The yellow box summarizes all of the formatting information for that paragraph. I love it but cannot seem to get it to appear consistently. Would anyone know what it is?

2. Your recent newsletters on styles that you and other book editors use have been very helpful. I had evolved to creating a template for the freelance work I do for a publisher. The compositor there uses Quark on a Mac. I've tried to make it easy for him to convert my PC Word files (RTF naturally) into Quark. I'd like to make a template for the authors who often do not know how to use styles. Has anyone created a basic template for the poor dears who reformat all of their Normal-style paragraphs manually? A template that also guides them?

Thanks to all for their comments and tips.

_________________________________________

RESOURCES

Some people enjoy creating and making available even more toolbar buttons. Here's one commercial source:

http://www.amfsoftware.com/word/icons.html

And a free one:

http://www.softpile.com/Business/Miscellaneous/Review_01543_index.html