Mighty Macros

If you need to work quicker and smarter, you can easily speed up your computing by automating common tasks. To do this you need to become familiar with macros, which are useful programs you can customise as you like. This month WINDOWS kicks off its two-part macro guide by examining the macro functionality built into Word

  • E-Mail
By  Matthew Wade Published  November 23, 2004

Mighty Macros|~|Macro-1-workshop-main.jpg|~|With one click of a shortcut, macros can turbocharge common keyboard tasks|~|A macro is a highly productive tool. With one click of a button, macro programs can perform a series of predetermined actions, which you can use to run tedious, repetitive tasks on command. This can not only save you time but it just might keep your brain from stagnating too. Almost any repetitive task can be 'macro'd', whether it's an Excel calculation, a set of Word formatting changes or logging in and checking multiple e-mail accounts. Many software programs provide built-in macro capabilities, such as Excel and today’s focus, Word. What Programs Exist General purpose macro programs and application-specific variations are both available. If the application to which you would like to add a macro doesn't support macros, then a general purpose program will be required. There are other situations in which general programs are the way forward. For instance, if your application supports macros but requires you to write code and that isn't up your street, go the general route. If you work with numerous applications every day, it might be less intense to learn one macro program than five or six, so keep it general. Finally, if the task you want to automate involves copying data between applications, a general purpose program will allow this, whereas application-specific macros won't. However, if you spend most of your office time staring at Excel, Word, or other particular apps, it's probably best to keep your macro learning specific to these titles. Macros can be easily divided into two distinct categories: macro recorders allow you to 'record' a macro by clicking ‘record’ and carrying out the actions you want to replicate. These actions are then simply re-played each time you initiate the macro. You do not need specific programming knowledge to use macro recorders. Task automation software meanwhile uses a small macro language of its own. Some titles also offer macro recording and re-play capabilities. This means you can record a macro or automation script and then use an editor to edit the script, add new actions, or even totally rewrite the macro from scratch. The term 'keyboard macros' refers to a shortcut keyboard command that performs a predetermined series of keystrokes when pressed. These macros might be built into an application, such as Ctrl/O (File,Open) in MS Word. Some vendors also offer tools that can be used with any Windows program, letting you define your own shortcuts for tasks such as shutting down your PC or opening specific files. Keyboard-mouse macro programs are also available, which are useful for more complex tasks and can record keystrokes across many applications. Word 2000: Macro basics There are two ways to create a macro in Word: you can either use Word’s built-in macro recorder or write your own macro script using Microsoft’s VisualBasic, for which you'll need programming know-how. As this is the first part of our macro guide, we’ll get started down the easier macro recorder route: Macros in Word 2000 can either be tied to a particular toolbar button, menu item or shortcut key. Alternatively, pressing Alt/F8 will take you to the same macro options as clicking through to Tools/Macros. From this window you can view a list of available macros, add new macros and more. Check out the full list of preprogrammed macros by choosing ‘Macros in: Word Commands’ in the macro window. Word macros can be stored in specific templates, such as Elegant Fax for example, but the default save setting applies them to Word's Normal template. To attach a macro to the normal template (normal.dot), this can be done either directly in that template or any current Word document. To build a macro into a different template, that template must already be open. Before we get started recording a macro, be sure to check the actions you want automated don’t exist in an existing Word macro and make a few preparations: for instance, plan out the commands and the order in which you need the macro to perform these. Make sure you know the shortcut keys for the commands you plan to use, as you cannot use the mouse for navigation when you are recording a macro. It’s a case of keys only. Your final macro will be leaner and therefore quicker if you use shortcut keys rather than arrow keys, as the recorder follows every keystroke you make. Less is better. Also consider what messages Word might display and that will stop the macro. Finally, run at least one test before you start recording to check your plan is solid. If you’re ready, let's work through recording an example macro. This particular macro will align a sentence to the left and italicise it. 1 - Click Tools/Macro (or use the Alt/F8 shortcut) and choose Record New Macro. 2 - Name your macro. This can contain up to 80 letters and numbers. It must begin with a letter though and there can be no spaces between words, so in this case we'll go for LeftItalSentence. Be careful not to choose the same name as one of Word’s in-built macros, or at least know that if you do the original will be replaced. Also, if you think it may prove useful to elaborate on what the macro does, be sure to fill out the Description dialog box. 3 - If you want to assign your macro to a toolbar or keyboard shortcut, click the relevant keyboard or toolbar button and choose your shortcut. Use the '+' symbol between Control and the relevant letter (i.e. Ctrl+V). Simple. 4 - Once you have decided this and clicked Close, the Stop Recording toolbar will appear and your mouse cursor will turn into a cassette tape (or 'record') icon. 5 - Carry out the actions you want to ‘macro’. In our example for instance, we would press Ctrl/Shift and the down arrow to highlight the first line's text. Next we would use Ctrl/I will italicise the line, followed by Ctrl/L to left align the line. 6 - Click on the Stop Recording button. It's worth remembering that should you want to use the macro in various documents, you must make sure the actions you record are not specific to just one document but will work equally effectively across different Word documents. If you use a macro regularly, be sure to assign it a shortcut as this will greatly speed up your macro use. QUICKLY DOES IT These common Word shortcuts will help speed up your word processing: ctrl/b Bold highlighted text ctrl/c Copy highlighted text ctrl/d Opens Format Font dialogue box ctrl/e Centre paragraph text ctrl/f Find and replace ctrl/o File Open ctrl/p File Print ctrl/s File Save ctrl/v Paste last copied text ctrl/x Cut highlighted text ctrl/y Redo ctrl/z Undo SHARP SHORTCUT GUIDES www.fgcu.edu/support/office2000/word/shortcuts.html http://word.mvps.org/FAQs/General/Shortcuts.htm Look out for the February 2005 issue of WINDOWS MIDDLE EAST, in which we explain how to get the most from Excel’s built-in macro functions.||**||

Add a Comment

Your display name This field is mandatory

Your e-mail address This field is mandatory (Your e-mail address won't be published)

Security code