Indian Talent, Global Content |
New and Improved: May 2012
Just Launched - New eStore selling travel guides, editing courses, ebooks and special offers |
How to Work with Macros: A Tutorial
Introducing MacrosThere may have been many instances where you have had to perform routine tasks repeatedly in a document. For example, while working on a project report you may need to write a biography of each individual that you interview on every page. You also need to affix the individual’s photograph and type the name in a particular style and position. You have to affix the photograph on the left margin and wrap the text to the right of the photograph. Imagine repeating the same task for the dozen or so individuals you want to profile! Now, what if you could automate this task by simply clicking a button on the toolbar? The Macro tool allows you to do just that. With the help of a macro you can record your keystrokes and mouse operations as a series of commands to be played back at a later time. Just like a well-orchestrated symphony! There are several advantages of using macros: Remember that there are over 900 commands available in Word, some of which are assigned to menus and toolbars. Therefore, you need to ensure that the macro you are creating is not already available. To view the list of available macro commands in Word: 2. Select Macro and then Macros from the submenu. The Macros dialog box appears. 3. Select Word commands in the Macros in drop down box. An alphabetical list of all commands is displayed in the Macro name box. 4. Select a command name. On selecting a name, a description of the If the macro that you want to create is already listed, do not create another one. If you give a new macro the same name as an existing command, the actions of the new macro will replace the existing actions. Creating a MacroOnce you have decided which macro you want to create, you need to prepare in advance before you actually begin its creation. You need to: ? Ensure that you have your steps memorized. This is important as the recorder will record each keystroke or mouse operation and include it in the macro. You can create a macro in two ways:? By recording steps Creating a Macro by Recording StepsTo create a macro by recording steps: 1. Click Tools on the menu bar, point to Macro, and click Record New Macros. The Record Macro dialog box appears. 2. Type a name for your macro in the Macro name box. Caution: While assigning a name to your macro, ensure that the name does not have any spaces or symbols. For example, you cannot name your macro as New Template.dot. The correct name would be NewTemplate.dot. 3. Select the document or template in which you want to store your macro in the Store macro in box. Note: Word makes your macro available to all documents by default. 4. Type a description for your macro in the Description box. 5. Click Toolbars if you want to assign the macro to a toolbar or menu. The Customize dialog box appears. 6. Click the Commands tab. 7. Select the macro you are recording in the Commands box and drag it to the toolbar or menu you want to assign it to. Optionally, if you wish to assign the macro to shortcut keys, click Keyboard. The Customize Keyboard dialog box appears. In the Commands box, click the macro you are recording. In the Press new shortcut key box type the key sequence. Save the Macro in the desired file and then click Assign. 8. Click Close to begin recording the macro. You will notice a Record Macro toolbar on the upper left corner of your screen and the mouse pointer will have a small icon that indicates that your actions are being recorded. 9. Perform the actions you want to include in your macro. Press the Pause 10. Click the Stop Recording button to stop recording your macro. Creating a Macro Using VBA EditorYou can also create a macro by using a Visual Basic Applications (VBA) Editor. In fact, all macros are actually Visual Basic subroutines. A macro begins with the word Sub, the name of the macro, followed by parentheses, and ends with the word End Sub. Everything else in between is part of the code. For example: To create a macro using VBA Editor:1. Click Tools on the menu, point to macro, and click Macros. The Macro dialog box appears. Assigning Keyboard Shortcuts to a MacroSo, you have created a macro or macros to help you work faster on your documents and do away with repetitive tasks. However, in your quest to save time you actually end up creating half a dozen macros! You surely don’t want to waste time searching for these macros in the Macros dialog box, do you? What can you do? You can assign a keyboard shortcut to your macro. That way, you can simply run your macro with the click of a mouse or by pressing a shortcut key. To assign a shortcut key to a macro:1. Click Tools on the menu bar, and click Customize. The Customize dialog box appears. 2. Click Keyboard. The Customize Keyboard dialog box appears. 3. Scroll down the Categories box. 4. Select Macros. 5. Select the macro to which you want to assign the shortcut key in the Macros box. Note: If the macro has a keystroke assigned to it, the keystroke will appear in the Current keys box. 6. Type the new shortcut key in the Press Shortcut key box if no shortcut key has been assigned to the macro or if you want to create a second shortcut key for your macro. 7. Click Save changes in box to save your changes. If you wish to apply the changes to all Word documents select Normal from the drop down list. However, if you wish to use the shortcut key only in the current document, select the document name from the list. 8. Click Assign, and then click Close. Running a MacroOnce you have assigned a shortcut key to your macro, you are now ready to run the macro. To run a macro: 1. Click Tools on the menu, point to Macro, and click Macros. The Macro Name box is displayed. Alternately, you can also press the shortcut key to which the macro is assigned. Setting the Macro Security LevelSometimes you may be unable to copy macros from one document to another or transfer files that contain macros from one computer to another. One of the reasons why this may happen is that Word by default sets its macro security level to High to ward off macros with viruses or from suspicious sources. To change the macro security level: 1. Click Tools on the menu bar, and click Options. The Options dialog box appears. Creating a Macro to Format TextIf you frequently need to work on a document that requires heavy formatting, create a macro. Creating a macro to format your document is quite simple: 1. Select a section of the document where you want to apply the formatting. Run the macro. Any text that you now enter will retain the formatting.
>> Read more articles written by Chillibreeze writers:1. Articles related to Content and Outsourcing
|
Premium Services
Products Must Reads... Upgrade Your Writing |
Copyright 2004 - 2011 Chillibreeze Solutions Pvt. Ltd. |
