“I’m never going to get my head around macros and wildcards!” I hear this quite a lot and, I have to confess, I make sure I only sigh on the inside. I hope that having read my Macro baby steps posts that you will realise almost everyone who uses a computer to edit (or proofread) text should be able to install and/or record at least a few simple macros. I am equally convinced that most editors could keep a list of handy wildcards to use on occasions. But, people talk about these things as if macros and wildcards are essentially the same thing – which they are not – and as if they are equally baffling, whereas, in fact, they are quite different and making use of each needs a different set of skills.
A macro is basically a set of instructions that automates a sequence of actions. In Word, you access, create or record your macros via the ‘Macros’ menu on the ‘View’ tab or the ‘Developer’ tab. Macros are useful for editors because automating a sequence of actions can save us a lot of typing and, therefore, time. The macro never gets tired, so will repeat the sequence of actions as many times as we want and will be as accurate at the end as it was at the beginning.
Macros can be extremely simple ...
Macros can make changes in your documents or can produce new documents which contain information about your document while leaving the original document untouched (have a look at some of Paul Beverley’s document analysis macros).
If you want to write your own macros, you have to use a programming language called Visual Basic for Applications (VBA).
VBA is a cut-down version of a programming language and is designed so that people who aren’t computer programmers can program their own macros. Obviously, some of us find any level of computer programming quite a scary prospect, so Word also allows us create macros by recording our own sequence of events that we want to automate without having to worry about learning to program at all.
Word allows us to edit our macros if we want to (see How to edit a macro), which can be handy if you have a macro that does one thing (eg, counts up in 1s) and you want it to do something similar but not quite the same (eg, count up in 2s).
Sometimes updates in Word or VBA can mean that macros will just stop working and so they have to be edited to make them work again.
VBA doesn’t allow you to make macros that look “pretty”, so any boxes that pop-up with questions, or any text that a macro produces will tend to look like they are straight out of a 1980s sci fi movie.*
Once you have a macro that works well, and you have added it as an icon on your Quick Access Toolbar, or assigned a keyboard shortcut to run it, you should be able to use your macro with very little thought.
Wildcards – or Word wildcard search and replace
This doesn’t sound particularly useful until a document lands on your desk in which all the:
Once you have worked out what pattern the changes you want to make follow, you need to work out the wildcard symbols that describe these categories. The Replace function duplicates the text found by the search so you can replace the hyphens between entirely different sets of numbers, as in the first example, or to move text around as in the other examples.
Getting to grips with writing wildcard searches does take a little practice, but I will write a post to help you get going. Once you understand the principles you should be able to keep a set of wildcard searches that other people have written and adapt them to use on your own documents.
The advantage of wildcard searches is that they are very specific, so they will only find exactly what you ask them to find. It might not surprise you to know, that this is also the thing that makes them extremely tricky. If you have typed in a search that looks for something that is ever so slightly different from what is in your document, the search won’t find anything – and there are no friendly messages that pop up saying “You searched for something that looks a bit like this, is this what you meant?”. This means that everybody who uses wildcards will spend a certain amount of time scratching their heads, wondering what they have done wrong (one of the most common things is not ticking ‘Use wildcards’ in the search function!).
Having said that, once you have got your wildcard searches sorted out, they do save a lot of time tidying up those mechanical jobs (eg, references!) that are a nightmare to do by hand.**
*It is possible to make Word tools that look more professional than most macros, but you need to use Word Add-Ins which have to be created by professional programmers (or, at least a programmer who knows what they are doing). One of the best-known Word Add-Ins is PerfectIt – which is one of the editing tools that I think everyone should have.
**The latest versions of PerfectIt have a Wildcards section in the stylesheet editor so I save as many of my wildcard searches there to save me having to create them from scratch every time.
Andrea at Yours Truleigh Editing