Don’t run screaming from macros

Whenever I’ve done training classes for law firms, the biggest bugaboo is always macros.

“Oh, no,” they cry. “That’s waaaaay too advanced for me!”

Um … no. It’s not. I promise.

People have this idea that, if they record a macro and make a mistake, it’s going to so totally screw things up they’ll never get their document fixed.

But if you’re looking to do things faster as your workload continues to pile up, macros can be a great time saver.  So many of the things you have to do repeatedly can be <gasp!> programmed.

And to prove that recording a macro is not such an advanced skill, Vivian Manning at Small City Law Firm Tech has a tutorial called Recording a Simple Word Macro.  She even shows you how to save your macro as a button on your Quick Access Toolbar (What? You’re not using that? You should!).

There, I wrote it – tempting most of you to run screaming from the blog.  Please come back, it’s not nearly as difficult as you imagine.  In fact, recording a simple macro is not difficult at all.  I promise!

All a simple, recorded macro in Word is, is this:

  • You tell Word, by turning on the Record Macro function, that you want it to record all of your Mouse Clicks / Keystrokes, until you turn the Record Macro function off again.
  • You tell Word whether you prefer to ‘run’ the Macro by way of a keyboard shortcut *or* a click of an icon.  All ‘running a macro’ means is forcing Word to replay the keystrokes that you recorded.

That’s all there is to it.  If you’re still reading, I’m going to show you how easy this is, and why you might want to ‘record’ and ‘run’ a macro.  Not run from it…

Click here to see the entire tutorial (with screen shots and everything). Note: Unfortunately, Vivian Manning’s blog is now offline. The Wayback Machine has an archived copy here.

Now, go.  At least try to record a simple macro.  And then come back and tell me how it went in the comments below!

About the Author

I spend an inordinate amount of my time playing with computers and attempting to explain technology to lawyers and law office staff. It's not always easy, but someone's got to do it.

jessica

Oh, Wow!!! And here I thought macro = evil spawn

    Deborah Savadra

    You’re not the only one! Just try a tiny one … they’re not so bad. 😉

Franklin Hickman

I defined a macro successully, with a button on the Quick Access Tool Bar. It works until I log off. After re-entering and trying the macro, I get an error message “Run Time error 5941 The requested member of the collection does not exist.”

Any suggestions?

    Deborah Savadra

    As I understand it, you’re attempting to program a macro to type the word “Page” then the page number. I’ve noticed that, in some cases (and contrary to how macro recording USED to work), the commands from the Word ribbon don’t get translated into the correct settings in the final macro code.

    I ran at your particular problem from another angle (using Insert Field rather than Insert Page Number) and tested this macro successfully:

    Sub test()
    '
    ' test Macro
    '
    '
    Selection.TypeText Text:="Page "
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
    "PAGE \* Arabic ", PreserveFormatting:=True
    End Sub

    That should work a bit better.

Inserting page numbers via macro in Microsoft Word 2010

[…] reader recently took up my challenge to not run screaming from macros … and was a little disappointed in the results. I defined a macro successfully [to insert […]

Using File | Save All to Save Macros to the Normal Template

[…] attorney reader (whose employer is using Word 2003) contacted me about a curious macro problem: I have created a macro for my signature for e-filing, etc., and it works in any document I […]

How to print envelopes in Microsoft Word

[…] make this even easier for myself, I’ve created a macro for these settings and placed a shortcut button on my Quick Access Toolbar. That way, every time […]

Getting rid of hard line breaks in pasted text

[…] the one that I suggested to him (with the admission that it was a less-than-ideal solution) was to create a macro that automated the several keystrokes it took to go to the end of each line, insert a space, delete […]

Alec Henderson

After two decades of macro-avoidant practice your blog infused me with the confidence to try again. But alas, your friend’s ‘record a simple macro’ tutorial is
no longer available.

Pam Rozsa

Can logic be used in macros — if/then sequences? Ex. if the property address contains NY then make all references to a state NY. If macros aren’t the solutions, do you know of another tool?

Also, can macros be included in Word templates that pull from another source for document automation?

Thank you.

Comments are closed