How to Add a Macro to Word

Button with the word macro on it, by Matt Scott.By C. K. MacLeod

Macros can help you to identify areas in your writing that need improving. You can also use macros for formatting and editing tasks. Some word processing programs, like Microsoft Word, can handle macros. You'll find a list of writing macros you can try in the post Improve Your Writing With Macros, and the video below will show you how to add a macro to Word 2010:

Steps for Adding a Macro to Word

  1. Go to the View tab, and click on Macros in the Window area.
  2. Name your macro in the Macro name: box. Be sure your name has no spaces between words. For example, NeedlessWords.
  3. Click Create. You will now be taken to Word's VBA editor. This is where Word stores macros.
  4. Copy the macro script and paste it into Word's VBA. It will show you where to paste your macro (look for the section that has the same name as the macro you just named). Delete all the text that's there (everything from Sub to End Sub) and paste your macro script into the VBA editor.
  5. Close Word's VBA editor by going to File, Close and Return to Microsoft Word. Your macro will be saved and you can now use it with any Word document.

Next step: How to Run a Macro in Word.

For further instructions on how to use macros, see Macros for Editors, in which Paul Beverley offers detailed instructions for understanding and running macros in various versions of Word.

Image by Matt Scott

How to Use FRedit: A Find and Replace Macro

by C.K. MacLeod

Work horse

Do you use Find and Replace in Word for editing tasks? Want to supercharge your mad Find and Replace skills? Here’s how.

Recently, editor Paul Beverley contacted me to show me how FRedit, a macro that he wrote, can be customized to perform a bunch of useful writing and editing tasks. It’s a find and replace macro, which means that it can take a slew of find and replace tasks that you’d normally do one at a time, and execute them all at once.

If you’ve been nervous about trying a macro, this is your way in. This find and replace macro will allow you to list, in a Word document, all the find and replace tasks you want to do. Run the macro and it will do them for you all at once.

An added bonus: You can keep the list for future writing or editing projects, or you can create customized lists for each project you work on.

Now how does that sound?

Trying FRedit

I gave FRedit a try. I wanted to see if it could identify and highlight words whose meanings writers tend to mix up. It can. In fact, FRedit performed better than the Confusables macro that I posted here. It was able to find words in all their forms. For example, the macro will pick up compliment, complimented, compliments, complimentary, complimenting, etc.

And as it turns out, FRedit can do a host of other things, too. Such as Wildcard searches. You are only limited by your imagination, and your understanding of Word’s Find and Replace and Wildcard codes!

How to Use FRedit

  1. Download the FRedit macro from Archive Publishing.

  2. Add the macro script, or code, to Word’s VBA. If you’re not sure how to do this, this 20-Minute Macro course will get you started.

  3. To use FRedit, you need two documents open:

a. The Word file containing your writing
b. A “script” file that tells FRedit what to do

In my case, my script file contained a list of of commonly confused words.

Confusables script

You can get the Confusables script here. Copy and paste it into a Word document.

4. Run the FRedit macro.

Tip: Have only two Word documents open when you run FRedit: your script file and the document containing your writing.

A Flexible Tool

FRedit is a flexible tool. You can use any script, correctly written, to get FRedit to do something different each time. The instruction file that accompanies the macro offers examples and guidelines for how to make the most of this handy macro.

FRedit is a workhorse, and a boon for Mac users who often don’t have access to automated commercial editing tools. I’m already thinking about other ways to bend FRedit to my will.

Do you use FRedit? I’d love to hear how you use it!

Image by Martin Pettitt

A Macro for Commonly Confused Words

 

A Macro For Commonly Confused Words

By C.K. MacLeod

Updated July 30, 2015

Thanks to Eliza Dee for suggesting a tweak that makes this macro even better (see the comments below for details)! The macro script has been updated.

Adverse or averse? Assent or ascent? English contains many words that are easily confused—words that sound the same, but have different meanings and spellings.

Tackle potential confusables when it's time to edit your writing. The macro below will highlight commonly confused words in just minutes. After you run the macro, check the highlighted words to see if you've used them correctly. Refer to this list to look up any words you're unsure of.

Tip for editors: use this macro to make potential confusables stand out during a first pass.

Quick Steps

  1. Copy and paste the macro into Word's VBA.
  2. Run the macro on your writing.
  3. Remove highlighting from words as you check them.

Sub Confusables()
' Highlights confusables
'
' Written by Roger Mortis, revised Subcortical, Jami Gold, C.K. MacLeod and Eliza Dee; word list, Commonly Confused Words by Oxford Dictionaries http://www.oxforddictionaries.com/words/commonly-confused-words
'
Dim range As range
Dim i As Long
Dim TargetList
TargetList = Array("accept", "except", "adverse", "averse", "advice", "advise", "affect", "effect", "aisle", "isle", "altogether", "all together", "along", "a long", "aloud", "allowed", "altar", "alter", "amoral", "immoral", "appraise", "apprise", "assent", "ascent", "aural", "oral", "awhile", "a while", "balmy", "barmy", "bare", "bear", "bated", "baited", "bazaar", "bizarre", "birth", "berth", "born", "borne", "bow", "bough", "break", "brake", "broach", "brooch", "canvas", "canvass", "censure", "censor", "cereal", "serial", "chord", "cord", "climactic", "climatic", "coarse", "course")
For i = 0 To UBound(TargetList)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdViolet
Loop
End With
Next

Dim TargetList1
TargetList1 = Array("complacent", "complaisant", "complement", "compliment", "council", "counsel", "cue", "queue", "curb", "kerb", "currant", "current", "defuse", "diffuse", "desert", "dessert", "discreet", "discrete", "disinterested", "uninterested", "draught", "draft", "draw", "drawer", "duel", "dual", "elicit", "illicit", "ensure", "insure", "envelop", "envelope", "exercise", "exorcise", "fawn", "faun", "flair", "flare", "flaunt", "flout", "flounder", "founder", "forbear", "forebear", "forward", "foreword", "freeze", "frieze", "grisly", "grizzly", "hoard", "horde", "imply", "infer", "loathe", "loath")
For i = 0 To UBound(TargetList1)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList1(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdViolet
Loop
End With
Next

Dim TargetList2
TargetList2 = Array("lose", "loose", "meter", "metre", "militate", "mitigate", "palate", "palette", "pedal", "peddle", "poll", "pole", "pour", "pore", "practice", "practise", "prescribe", "proscribe", "principle", "principal", "sceptic", "septic", "sight", "site", "stationary", "stationery", "story", "storey", "titillate", "titivate", "tortuous", "torturous", "wreath", "wreathe")
For i = 0 To UBound(TargetList2)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList2(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdViolet
Loop
End With
Next
End Sub


After you've addressed each highlighted word, use Paul Beverley's free UnHighlight macro to remove highlights, one instance at a time.

Not sure what a macro is? See this post for an explanation.

Learn how to use macros with this free 20-minute macro course. You can run macros in Microsoft Word or WPS Writer (pro version).

*The lists of words in this macro are from the Oxford Dictionaries website.

Image by Dvortygirl

Make Your Writing Readable with the Plain Language Macro

Embraced by wordsby C.K. MacLeod

Do you write or edit nonfiction? If you do, you need to know that readers are time pressed.

One way to make the reading experience more accessible to readers is to find ten-dollar words in your writing and swap them out with simpler words that most readers will be able to read and understand. It’s best to write as clearly and as simply as you can.

The PlainLanguage macro below will, with a few keystrokes, highlight in dark blue all the words in your writing that are difficult* to read and understand. Consider replacing these words with the alternatives listed at plainlanguage.gov:

Plain language site

*The difficult words in the macro script have been taken from the word list at plainlanguage.gov.

Copy the macro below from Sub to End Sub and paste it into Word's Visual Basic Application (VBA).

Remember to use judgement with the results of any macro. This macro will highlight difficult words, but only you can decide if each word is helping or hindering the reader.

Not sure what a macro is? See this post for an explanation. Also, see the free 20-minute Macro Course on this blog. It’ll have you up in running with macros in Word in no time!


Sub PlainLanguage()

' Highlights complex words
'
' Written by Roger Mortis, revised by Subcortical, adapted by

'Jami Gold and further adapted by C.K. MacLeod; word list:

'Simple Words and Phrases by www.plainlanguage.gov

'http://www.plainlanguage.gov/howto/wordsuggestions/simplewords.cfm#cd
'
Dim range As range
Dim i As Long
Dim TargetList
TargetList = Array("/", "a number of", "accompany", "accomplish", "accorded", "accordingly", "accrue", "accurate", "additional", "address", "addressees", "addressees are requested", "adjacent to", "advantageous", "adversely impact on", "advise", "afford an opportunity", "aircraft", "allocate", "anticipate", "apparent", "appreciable", "appropriate", "approximate", "arrive onboard", "as a means of", "as prescribed by", "ascertain")
For i = 0 To UBound(TargetList)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList1
TargetList1 = Array("assist", "assistance", "at the present time", "attain", "attempt", "basis", "be advised", "benefit", "by means of", "capability", "caveat", "close proximity", "combat environment", "combined", "commence", "comply with", "component", "comprise", "concerning", "consequently", "consolidate", "constitutes", "contains", "convene", "currently", "deem", "delete", "demonstrate")
For i = 0 To UBound(TargetList1)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList1(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList2
TargetList2 = Array("depart", "designate", "desire", "determine", "disclose", "discontinue", "disseminate", "due to the fact that", "during the period", "effect modifications", "elect", "eliminate", "employ", "encounter", "endeavor", "ensure", "enumerate", "equipments", "equitable", "establish", "etc.", "evidenced", "evident", "exhibit", "expedite", "expeditious", "expend", "expertise")
For i = 0 To UBound(TargetList2)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList2(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList3
TargetList3 = Array("expiration", "facilitate", "failed to", "feasible", "females", "finalize", "for a period of", "forfeit", "forward", "frequently", "function", "furnish", "has a requirement for", "herein", "heretofore", "herewith", "however", "identical", "identify", "immediately", "impacted", "implement", "in a timely manner", "in accordance with", "in addition", "in an effort to", "in as much as", "in lieu of")
For i = 0 To UBound(TargetList3)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList3(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList4
TargetList4 = Array("in order that", "in order to", "in regard to", "in relation to", "in the amount of", "in the event of", "in the near future", "in the process of", "in view of", "in view of the above", "inception", "incumbent upon", "indicate", "indication", "initial", "initiate", "inter alia", "interface", "interpose no objection", "is applicable to", "is authorized to", "is in consonance with", "is responsible for", "it appears", "it is", "it is essential", "it is requested", "liaison")
For i = 0 To UBound(TargetList4)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList4(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList5
TargetList5 = Array("limited number", "magnitude", "maintain", "maximum", "methodology", "minimize", "minimum", "modify", "monitor", "necessitate", "notify", "not later than", "notwithstanding", "numerous", "objective", "obligate", "observe", "operate", "optimum", "option", "parameters", "participate", "perform", "permit", "pertaining to", "portion", "possess", "practicable")
For i = 0 To UBound(TargetList5)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList5(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList6
TargetList6 = Array("preclude", "previous", "previously", "prior to", "prioritize", "proceed", "procure", "proficiency", "promulgate", "provide", "provided that", "provides guidance for", "purchase", "pursuant to", "reflect", "regarding", "relative to", "relocate", "remain", "remain", "remainder", "remuneration", "render", "represents", "request", "require", "requirement", "reside")
For i = 0 To UBound(TargetList6)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList6(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList7
TargetList7 = Array("retain", "said", "selection", "set forth in", "similar to", "solicit", "some", "state-of-the-art", "subject", "submit", "subsequent", "subsequently", "substantial", "successfully complete", "such", "sufficient", "take action to", "terminate", "the month of", "the undersigned", "the use of", "there are", "there is", "therefore", "therein", "thereof", "this activity", "time period")
For i = 0 To UBound(TargetList7)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList7(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next

Dim TargetList8
TargetList8 = Array("timely", "transmit", "type", "under the provisions of", "until such time as", "utilization", "utilize", "validate", "viable", "vice", "warrant", "whereas", "with reference to", "with the exception of", "witnessed", "your office")
For i = 0 To UBound(TargetList8)
Set range = ActiveDocument.range
With range.Find
.Text = TargetList8(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBlue
Loop
End With
Next
End Sub


Image by Robbert van der Steeg

Hunt Down Adverbs with a Macro

by C.K. MacLeod

...the road to hell is paved with adverbs and I will shout it from the rooftops.

~Steven King

Adverb

Do you use -ly words in your writing? Do you use them with the dialogue tags he said and she said?

Example: "Who do you think you are?" she said arrogantly.

According to author Steven King, using adverbs in your writing, particularly with dialogue tags, can be a problem.

You can hunt down -ly adverbs with a macro. Karen Woodward has good multipurpose -ly macro, or you can insert your own list of -ly words in the macro script below (I've gotten you started). The Reading Teacher's Book of Lists, by Edward Bernard Fry et al. has a fabulous list of adverbs commonly used with dialogue tags.

Copy the macro from Sub to End Sub and paste it into Word's Visual Basic Application (VBA). Word will highlight all of the adverbs in bright green.


Sub lyWords()
'
' Highlights -ly words used in tags
'
' Written by Roger Mortis, revised by Subcortical, adapted by Jami Gold and tweaked by C.K. MacLeod
'
Dim range As range
Dim i As Long
Dim TargetList
TargetList = Array( "angrily", "cautiously", "happily", "sadly",  "unhappily")

For i = 0 To UBound(TargetList)

Set range = ActiveDocument.range
With range.Find
.Text = TargetList(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBrightGreen
Loop
End With
Next
End Sub


Remember to use judgement with the results of any macro. This macro will highlight -ly words, but only you can decide if each word is helping or hindering your writing.

Not sure what a macro is? See this post for an explanation. See also the videos for adding a macro and running a macro in Microsoft Word 2010.

What do you do with the highlighted words this macro finds? See Carla Douglas' post at the Beyond Paper Editing blog for suggestions.

Image by Quinn Dombrowski

Find Passive Words in Your Writing

Verb, pure verb

Passive words can make your writing dull. Use this macro to find passive words so you can replace them with strong, active words. Word will highlight passive words in bright green.

Copy the macro from Sub to End Sub and paste it into Microsoft Word's Visual Basic Application (VBA). This free 20-minute macro course will show you how.


Sub PassiveWords()

' Highlights passive words

' Written by Roger Mortis, revised by Subcortical, adapted by Jami Gold and tweaked by C.K. MacLeod; words selected from Ryan Macklin's passive words list at http://ryanmacklin.com/2012/05/passive-voice-words/

Dim range As range
Dim i As Long
Dim TargetList
TargetList = Array("be", "being", "been", "am", "is", "are", "was", "were", "has", "have", "had", "do", "did", "does", "can", "could", "shall", "should", "will", "would", "might", "must", "may")

For i = 0 To UBound(TargetList)

Set range = ActiveDocument.range
With range.Find
.Text = TargetList(i)
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
Do While .Execute(Forward:=True) = True
range.HighlightColorIndex = wdBrightGreen
Loop
End With
Next

End Sub


Remember to use judgement with the results of any macro. This macro will highlight passive words, but only you can decide if each word is helping or hindering your writing.

Image by Rebecca Siegel