Mark Ward’s Microsoft Word Miracle Macro
Back in September of 2003 I had this problem, see. I would often paste text into Microsoft Word that included “straight quotes” instead of “smart (curly) quotes.” I didn’t like having to go through and change them to curly, so I set up a macro. All it did was find and replace all quotation marks; Word’s auto-correct feature did the rest.
Over time other common problems developed, so I added more code to what soon became my standard Word macro—kind of like an automatic diagnostic I use on nearly all documents.
I needed to do things like this:
- Turn double hyphens (–) into em dashes (—).
- Turn two concurrent spaces ( ) into one space ( ). (This is a problem created by old people who learned to type during typewriter days: they customarily place two spaces after every sentence-ending punctuation. This practice was helpful for legibility when every letter and character was set at a fixed width, but modern word-processing makes it obsolete.)
- Turn em dashes with spaces around them (like — this) to em dashes with no spaces (like—this).
- Turn hyphens between numerals (Matt 22:34-40) into en dashes (Matt 22:34–40). (This is something few people catch or care about, but it’s “best practice” among typographers and editors.)
- Turn regular spaces into nonbreaking spaces in Scripture references such as “2 Sam.” (This is so one line doesn’t end with “2” and the next line start with “Sam.” Note: this only works if you use the standard SBL abbreviations.)
- Fix the direction of curly quotation marks which are adjacent to other punctuation marks like dashes and ellipses.
To use the macro, close Word, open a blank Word document, hit Alt+F8, click “Edit,” and paste the full text of the macro (click here to download or click here to copy) into your macros list at the bottom. Hit the save button in Visual Basic, then close Word, agreeing to save changes to Normal.dotm.
Open a document in Word, then open your Macros (Alt+F8 in both Windows and Mac). You should now see at least one macro in the macro list, and this one is named “MarkWardsMicrosoftWordMiracleMacro.” Select that macro and click “Run.” The macro will run.
You can assign a button or keyboard shortcut to the macro by right-clicking on the toolbar, selecting “Customize Toolbars and Menus,” and choosing the Commands tab (this is for Mac, but the process is similar in Windows). Then select “Macros” under the Categories, then find the macro in the right-hand pane and drag it to a spot in your toolbar. Or click Keyboard > Categories > Macros and assign a new keyboard shortcut to the macro.