Research Hacks #23: Three Microsoft Word macros for quick mark-up of articles, essays and thesis chapters

For academics who want to work faster, smarter and more effectively

I have the pleasure of reading a lot of student essays and supervising a number of research students, and over the years I have found that marking up an essay or thesis chapter before I read it helps me to focus and read effectively. The technique also speeds up the reading of articles in Microsoft Word format (I’ll deal with PDF in a future post). Below are three Microsoft Word macros I have written or adapted, and that I regularly use all three for performing a quick mark-up of essays and chapters before I read them.

To use the macros below:

  • Within Microsoft Word press ALT + F8 to get a list of the current macros in your normal.dotm template.
  • Click “edit” for any of the macros you see (it doesn’t matter which one). This will bring up the Visual Basic editor.
  • Scroll down to the bottom of the window and paste in the code I provide below.
  • Close the Visual Basic window. Simple! You might (but probably won’t) need to restart Word for the macros to take effect.
  • If you want to add keyboard shortcuts for the macros you will need to do so manually, as I can’t find a way to incorporate keyboard shortcuts into the macros themselves. Here’s how to assign the shortcuts, courtesy of Lorien on this page:
    • Click the Microsoft Office Button , and then click Word Options.
    • Click Customize.
    • Next to Keyboard shortcuts, click Customize.
    • In the Categories list, click Macros.
    • In the Macros list, click the macro that you want to change.
    • In the Press new shortcut key box, type the key combination that you want to choose.
    • Check the Current keys box to make sure that you aren’t assigning a key combination that you already use to perform a different task.
    • In the Save changes in list, click the option that matches where you want to run your macro. Important   To make your macro available in all documents, be sure to click Normal.dotm.
    • Click Close.
  • When you next quit Word you will see a prompt saying something like “Changes have been made that affect the global template, Normal.dot. Do you want to save those changes?”. Click “yes” if you want your new macros to be available next time you open Word.

To read all the research hacks posted to date, please click here.

1. Change the text colour of all quotations to orange:

I like using this because it shows me at a glance not only how many direct in-line quotations are being used, but how they are bunched or distributed throughout the document.

NB: this also converts all straight single and double quotation marks to curly quotation marks.


Sub AllQuotationsOrange()
'
' AllQuotationsOrange Macro

'First do a replace to make sure quotes are all smartquotes
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.HanjaPhoneticHangul = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.CorrectHangulEndings = False
.HanjaPhoneticHangul = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = -654245889
With Selection.Find
.Text = ChrW(8220) & "*" & ChrW(8221)
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = -654245889
With Selection.Find
.Text = "‘*’"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = -654245889
With Selection.Find
.Text = "«*»"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub

2. Highlight all punctuation (full stops highlighted in yellow; text colour of other punctuation changed to light purple):

This is useful for checking signposting as well as monitoring sentence length and following arguments across paragraphs.


Sub HighlightAllPunctuation()
'
' Highlight All Punctuation Macro
'***********************************************************

'set the colour
Options.DefaultHighlightColorIndex = wdYellow


'set the highlight option in the search box
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True

'do the search and replace
With Selection.Find
.Text = "."
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'set the colour
Options.DefaultHighlightColorIndex = wdPink

'set the colour
Options.DefaultHighlightColorIndex = wdYellow


'set the highlight option in the search box
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True

'do the search and replace
With Selection.Find
.Text = "?"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'set the colour
Options.DefaultHighlightColorIndex = wdYellow


'set the highlight option in the search box
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True

'do the search and replace
With Selection.Find
.Text = "!"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'light purple
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = ","
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'light purple
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = ";"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'light purple
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = ":"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll


'light purple
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = "("
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

'light purple
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Font.Color = wdColorRed
With Selection.Find
.Text = ")"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

End Sub

Highlight key words:

Allows the user to enter words in an input box, and highlights all occurrences of those words in the open document. It is quicker than using the search and replace box to highlight key words, and great for drawing your attention to key concepts as you read through an essay/chapter.


Sub BulkHighlight()
'
' BulkHighlight Macro
Do
'set the colour
Options.DefaultHighlightColorIndex = wdYellow

'ask for the word to highlight
sPrompt = "Please enter a word to be highlighted (leave blank and press 'OK' to exit)"
sWordToSearch = InputBox(sPrompt)
If sWordToSearch = "" Then Exit Sub
'set the highlight option in the search box
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Highlight = True

'do the search and replace
With Selection.Find
.Text = sWordToSearch
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Loop

End Sub

CC Image courtesy of eltpics on Flickr.
What academic Word macros save your time? Feel free to post them in the “Comments” section below.

LIKE THIS POST?
.
Sign up for my blog updates and never miss a post.





CC Image courtesy of Rachel Knickmeyer on Flickr

Please note: I reserve the right to delete comments that are offensive or off-topic.

Leave a Reply

Your email address will not be published. Required fields are marked *