Mark Ward’s Miracle Word-Macro Wonder

by Apr 20, 2009Tech3 comments

The MWMWMW is now available for free—for a limited time only (till the Internet dies, I guess).

Use this macro to 1) sharpen up any Word document and 2) impress nerdy people with proper use of a) en dashes and b) em dashes.

This macro replaces — with —. It also removes spaces surrounding em dashes, makes all hyphens between numbers into en dashes, turns all quotation marks and apostrophes into curvy quotes (as long as you have “Smart-quotes” turned on), replaces all double spaces with single spaces, and generally makes me feel good about the typographical state of my documents.

Just open a blank Word document, hit Alt+F8, click “Edit,” and paste the text below into your macros list at the bottom. Save and close Word, agreeing to save changes to Normal.dot. You can even assign a button or keyboard shortcut to this macro.

Sub MWMWMW()
' Mark Ward's Miracle Word-Macro Wonder
' Macro recorded Thursday, September 11, 2003 by Mark L Ward Jr
   Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "--"
.Replacement.Text = "—"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " — "
.Replacement.Text = "—"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " —"
.Replacement.Text = "—"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "— "
.Replacement.Text = "—"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([0-9])-([0-9])"
.Replacement.Text = "\1–\2"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Read More 

Home Studio Tour and Videography Kit

Home Studio Tour and Videography Kit

Updated 03/03/2021 Several friends have asked, so here’s a tour of my home video studio—which I set up for the second season of the Bible Study Magazine Podcast and for my own YouTube channel: https://youtu.be/TtVBIof3Olo Updated shot of my studio (3/3/21): And this...

Future.Bible Conference

Future.Bible Conference

In one week I'll be "speaking" "at" a "conference" on the future of the Bible that is all online—actually, I recorded the video today and am now uploading it. My talk was really fun to put together, and I gave it this title: "Anything Invented After You're Thirty-Five...

Leave a comment.

3 Comments
  1. James

    Coolness! But what have you got for Word 2008 users who don’t have macros…?

  2. Mark L Ward Jr

    This guy says you can code your VBA applications in AppleScript…

  3. Duncan

    I don’t know about Macs, but I still do VBA in Word 2007 (on Windows, mind you). In the Word Options dialog you turn on the Developer toolbar and then you can get into all the lovely internals of Office 07! (Or just type Alt+F11)

    In order to save macros in a 2007 Word doc, the file extension changes from*.docx to *.docm.

    Nice macro, BTW… I think a lot of those settings in the With Selection.Find blocks could be trimmed out though. Word always worries about too many details with recorded macros. I’ll let you know if I can achieve the same results with trimmed code.