Skip to main content

Macro to Search Typos in Microsoft Word

A new version of tool that works with both Word and PDF files is available at https://github.com/dilumb/Typos

Most of us tend to type some funny words or break a word into multiple words which are not captured by the spell checker. Inability of the spell checker to understand the context leads to this issue. Here is a Word Macro to detect such errors which I developed while writing my PhD proposal.

Macro searches for each word in the 'terms' array and move the cursor to the first occurrence allowing you to manually edit the word(s). It doesn't correct errors as some of the words are context sensitive and depends on the position of a sentence. You can always extend the to code to deal with common mistakes like writing 'in to' instead of 'into'. After each correction you need to rerun the macro. Simplest way to rerun is to assign a shortcut key to the macro. When all the words are searched you will see a message saying "Double Check Compete...!". Feel free to add your own words to the 'terms' array.


Sub Double_Check()
'
' Double_Check Macro
' This macro only points you to the first location of word that you may have misspelled or 

' written as multiple words. It doesn't correct errors as some of the words are context sensitive
' (can be extended if needed). You need to rerun the macro until all erros are corrected.
'
    'List of words that you have tendency to misspell or write as multiple words
    terms = Array("  ", "all most", "all ready", "all together", "all ways", _
                    "before hand", "can not", "community wide", "data center", _
                    "et. al.", "far away", "fig,", "further more", "in to", _
                    "my self", "testbed", "Wide spread")
   
    For Each my_item In terms
        Selection.Find.ClearFormatting
        With Selection.Find
        .Text = my_item             'term to search
        .Forward = True
        .Wrap = wdFindContinue
        .MatchCase = False          'case insensitive
        .MatchWholeWord = True
        End With
       
        If Selection.Find.Execute = True Then
            End                    ' exit if a match
        End If
    Next my_item
    MsgBox ("Double Check Complete...!")
End Sub


You can add a shortcut key to Word by going to Customize Quick Access Toolbar button (on top left corner) → More Commands... → Customize → Keyboard shortcuts. Press the Customize button.

Comments

Anonymous said…
Ironically, you have a typo in the 3d sentence of your intro above. 'wiring' => 'writing'

Popular posts from this blog

1. Building P2P Simulators with OverSim - Where to Begin

This could be a series of blog posts about extending or developing your own OverSim applications & overlay networks. OverSim has a minimal tutorial on writing your own application & overlay network; however, it doesn't show the big picture. So, I'm wasting lots of time playing with code & trying to understand the rest. Good thing is, I like it more & more as I understand. You need to change/develop only a few things, but finding out which ones is a hell of a task. I hope this will not only make my life easy but also will be useful to new comers. Here's what you need to do: You need some background on OMNeT++ OverSim extend OMNeT++. But sometime it has its own way of doing things (to make your task even simple) so understand the differences . Develop several OMNeT++ simulators. TicToc is a good one to start with. Extend it as you imagine. Read Towards a Common API for Structured Peer-to-Peer Overlays , which is the basis for OvseSim's AP...

Key Application Layer Functions

Constructor  Can be use to set message to NULL . Better not to skip defining the constructor. Destructor Can be use to clear/delete messages using cancelAndDelete() . New version seems to be motivating to use a destructor so better not to skip. void initializeApp(int stage) Can be used to initialize the application, read parameters from omnet.ini file, set statistic collectors, GUI display variables, start timers, set UDP port, etc. stage - Indicate which stage your are in. MIN_STAGE_APP indicates this module is being created while MAX_STAGE_APP indicates all modules were created. We typically need MIN_STAGE_APP to i nitialize application & variables. void finishApp() Called when application is terminating. Can be used to summarize stat. New version seems to be motivating us to delete messages in the destructor.   void handleTimerEvent(cMessage* msg) Handle event timer. Use to generate new periodic messages, other events, or check for lost messages. Bett...

Distributed Systems Mind Map

Though distributed systems are inherently distributed, autonomous, and parallel, all textbooks that I have read so far are boring & serial, going from one topic to another as they are independent topics. Wondering about how best to present all related topics and their relationships in my class, I came up with the following mind map. I was able to explain most of the key concepts using a single example of a web-based business that started selling flowers. It was a student who suggested that we consider selling flowers. It turned out to be a good example, as there had to be a connection to the physical world where the business also needed a geographical distributed delivery system. Taught of sharing the mind map. Though most of those branches can be broken down further this level of detailed was sufficient for my class (by the way it took 1 hour to finish the discussion on this slide). Distributed Systems Mind Map