Results 1 to 10 of 10

Thread: Automate repetitive tasks with word macros

  1. #1
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Automate repetitive tasks with word macros

    If you frequently edit Microsoft Word documents to correct style and spelling inconsistencies, then consider using the power of macros to speed things up. Macros offer a way to record repetitive tasks, so that when similar tasks must be performed, the recordings can be played back to do the job automatically.To make macros easier to manage, they can be given descriptive names and assigned to the menus or shortcut keys of your choice, making them even more convenient. Macros are like short computer programs, but with two big differences. Firstly, they can only be run within Microsoft Word and secondly, you don't need programming skills to create them. Here's how to save time in Word.

    STEP 1

    MACROS ARE A FEATURE of every version of Microsoft Word and they haven't changed much over the years. For this Workshop we've used Microsoft Word 2003, but any version from Word 97 to Word 2003 will work fine, though different versions will not look precisely like the screenshots featured here. Before you can start recording a macro, create a new document or open an existing document to work on. For the purposes of this Workshop, any existing document will do, but choose one that's at least a couple of pages in length.

    Name:  46465456.jpg
Views: 276
Size:  62.5 KB

  2. #2
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros A KEY PROBLEM

    STEP 2

    A KEY PROBLEM WITH many documents is consistency of style. For example, some people may write 'website'while others use 'web site: Our first macro will be one that searches for the word 'website' and replaces it with the phrase'web site; thus maintaining consistent spelling in cut-and-paste documents written by several authors. If you prefer things the other way around,just transpose the two phrases. Most of the work is done byWord's Find and Replace facility, so the macro merely records the process of setting up the search and carrying out the replacements. Before starting on the macro, modify the document you loaded in step one by typing up to 10 occurrences of'website' into it, scattered throughout the document. Save the new version as Test.doc.

    Name:  567987.jpg
Views: 276
Size:  50.8 KB

  3. #3
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros ON THE TOOLS MENU

    STEP 3

    ON THE TOOLS MENU select Macro, then click Record New Macro.ln the Record Macro dialogue box, type ChangeWebsite as the name for your macro (macro names must not contain spaces), then click OK. By default, Word macros are stored in a global template called Normal.dot.This makes them available to any document.The dialogue box drops out of sight leaving only a tiny Macro Recording toolbar containing two buttons:the one on the left stops recording and the one on the right pauses recording temporarily. From now on,actions made using the keyboard or mouse will be captured as part of the macro.

    Name:  5465465.jpg
Views: 241
Size:  23.3 KB

  4. #4
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros WHEN CREATING MACROS YOU

    STEP 4

    WHEN CREATING MACROS YOU should follow two principles.The first is to use keyboard shortcuts wherever possible, because menu and mouse actions are not always interpreted in the way you might expect.The second is to record only actions that work equally well in other documents, regardless of where the text cursor might be. For example, when creating a macro to search an entire document, the text cursor must first be positioned at the start of it.This will need to be the first action carried out by our macro, achieved using the keyboard shortcut Ctrl+Home (ie hold down the Orl key and tap Home) - do this now.

    Name:  677897.jpg
Views: 265
Size:  30.2 KB

  5. #5
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default

    STEP 5

    IF YOU NEGlECT TO place the cursor at the beginning of the document, Word displays a dialogue box when it reaches the end, asking if you want to search the rest of the document.This effectively destroys the sequence of the macro, and should be avoided.To invoke the Find and Replace dialogue box you could use the Edit menu and click Replace, but in line with our advice to use keyboard shortcuts wherever possible, it's better to use the shortcut key of Ctrl and H.

    Name:  54654658.jpg
Views: 231
Size:  18.2 KB

  6. #6
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default

    STEP 6

    IN THE FIND PANEL type'website' (omitting the speech marks on this and all other occasions when typing words into dialogue boxes). Press the Tab key to move the cursor to the Replace panel, and then type'web site:Vou'li notice that the Replace All button has an underline under the letter A, indicating that Alt and A is its shortcut key. Press Alt and A to carry out the substitutions, which will be made almost instantly.When
    a message box is displayed to tell you how many replacements have been made, press Enter instead of clicking OK.

  7. #7
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros TO CLOSE THE FIND

    STEP 7

    TO CLOSE THE FIND and Replace dialogue box, use Alt and F4.At this point you might think the macro is finished, but to make it as efficient as possible the cursor should be returned to the point it was at before sending it to the beginning of the document.The shortcut for this action is Shift and F6. Now end the macro by clicking the left¬hand Stop button on the Macro Recording toolbar, or if the tool bar is no longer visible you can open the Tools menu,select Macro,and click Stop Recording.

    Name:  454564.jpg
Views: 252
Size:  17.3 KB

  8. #8
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default

    STEP 8

    TO TES TTHE MACRO,c1ose Test.doc without saving the changes. Now reopen Test.doc: it should again contain 10 occurrences of 'website; which for the purposes ofthis Workshop is not the preferred style. Open the Tools, point to Macro and then Macros to open the Macros dialogue box, select the ChangeWebsite macro, then click Run. The macro will replace'website'with 'web site'throughout your document. If there's a problem, Word displays an error message containing End and Debug options. Should this happen, click End,and recreate the macro from scratch.The Debug option won't help much unless you understand Microsoft's Visual Basic programming language.

    Name:  6478789.jpg
Views: 238
Size:  14.4 KB

  9. #9
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros ANOTHER USEFUL TASK

    STEP 9

    ANOTHER USEFUL TASK FOR a macro is to remove extra lines that may have been inserted in a document.This can be done by searching for two consecutive paragraph breaks and replacing them with one. If running the macro once doesn't get rid of every blank line, keep running it until they've all gone.To create such a macro, first add some blank lines to Test.doc so there's something to work with. Save the revised version,and then use step three as a guide to starting a new macro called 'RemoveBlanks'.

    Name:  354654.jpg
Views: 236
Size:  19.6 KB

  10. #10
    vandana43 is offline Senior Member
    Join Date
    Mar 2008
    Posts
    311
    Rep Power
    5

    Default Word macros USE THE CTRL

    STEP 10

    USE THE CTRL AND Home keyboard shortcut to move to the start ofthe document.Use Ctrl and H to open the Find and Replace dialogue box.The code sequence for a single paragraph break is the two characters lip, so to find a double paragraph break you need to type IIpllp. On a standard Qwerty keyboard the II symbol is found above the 6 key - hold down Shift and tap 6 to get it. When you've entered IIpllp into the Find panel, press the Tab key to move the cursor to the Replace panel, then type lip as the replacement.To perform the replacements use Alt and A. After completion, press Enter to close the message box, then Alt and F4to close the Find and Replace dialogue box.

    Name:  65689.gif
Views: 180
Size:  9.4 KB

Similar Threads

  1. Configuring Word 2007 to Support Macros
    By Williamsjones in forum Software Jargons
    Replies: 0
    Last Post: 01-15-2010, 01:07 PM
  2. Automate Windows by scheduling tasks
    By Jadarius Hugue in forum Windows Vista
    Replies: 0
    Last Post: 07-01-2009, 06:22 AM
  3. Wireless Tip - Automate Hotspot Log-Ins
    By uncosto46 in forum Everything Else
    Replies: 0
    Last Post: 07-18-2008, 05:14 PM
  4. Automate recurring charges
    By terank in forum Web. 2.0
    Replies: 0
    Last Post: 06-25-2008, 04:29 PM
  5. Automate Your Desktop with wmctrl
    By techsavvy in forum Applications
    Replies: 0
    Last Post: 04-08-2008, 03:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48