Home Register Members List Search Today's Posts Mark Forums Read

Go Back   TechFuels Forum > Software > Applications

Reply
 
LinkBack Thread Tools
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:20 AM
  #1 (permalink)
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: 40
Size:  62.5 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:24 AM
  #2 (permalink)
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: 40
Size:  50.8 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:28 AM
  #3 (permalink)
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: 41
Size:  23.3 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:31 AM
  #4 (permalink)
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: 67
Size:  30.2 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:35 AM
  #5 (permalink)
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: 41
Size:  18.2 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:39 AM
  #6 (permalink)
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:45 AM
  #7 (permalink)
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: 41
Size:  17.3 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:48 AM
  #8 (permalink)
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: 42
Size:  14.4 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:51 AM
  #9 (permalink)
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: 41
Size:  19.6 KB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
vandana43
Senior Member
 

vandana43 is offline  
Old 03-06-2008, 05:54 AM
  #10 (permalink)
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.

Automate repetitive tasks with word macros-65689.gif
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word Advanced tips techno23 Applications 0 02-22-2008 11:53 AM
New vulnerability in Microsoft Word techno23 Applications 0 02-16-2008 10:11 AM
Microsoft Word 2007 techno23 Applications 0 02-15-2008 09:06 AM
New XML Format in Word 2007 techno23 Applications 0 02-14-2008 10:13 AM
Atlantis Word Processor techno23 Applications 0 02-08-2008 06:55 AM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Copyright Techfuels -->
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151