Pulling Out Spelling Errors

Written by Allen Wyatt (last updated June 26, 2018)
This tip applies to Word 97, 2000, 2002, and 2003


6

Word includes a power spellchecker that allows you to determine which words in a document need your attention. Sometimes, it might be helpful to have all the misspelled words in one place, rather than throughout the document. If you have this need, the following VBA macro will gather all the misspelled words from one document and place them in a new document.

Sub GetSpellingErrors()
    Dim DocThis As Document
    Dim iErrorCnt As Integer
    Dim J As Integer

    Set DocThis = ActiveDocument
    Documents.Add

    iErrorCnt = DocThis.SpellingErrors.Count
    For J = 1 To iErrorCnt
        Selection.TypeText Text:=DocThis.SpellingErrors(J)
        Selection.TypeParagraph
    Next J
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1465) applies to Microsoft Word 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Deleting Table Columns with Track Changes Turned On

If you are editing a document with Track Changes turned on, Word won't let you delete a column in a table and have it ...

Discover More

Putting Spreadsheet Names in Headers or Footers

One of the things you can add to your page header or footer is the name of your workbook file name. Here's how to make ...

Discover More

Identifying Merged Cells

Merging cells is a common task when creating worksheets. Merged cells can play havoc with the normal functioning of some ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Hiding Grammar Errors

Are you bothered by the green underlines that Word uses to mark potential grammar errors in your document? You can hide ...

Discover More

Separating Grammar-Checking from Spell-Checking

Most of the time Word will check both grammar and spelling at the same time. You can, however, instruct the program to ...

Discover More

Checking for Sentences Beginning with Conjunctions

In my English classes in junior high, I would get marked down if I started sentences with a conjunction. ("There's a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2020-03-26 23:17:33

Edgar Kretschmann

Hi Allen
this is Edgar,

I have found your macro and it is a great help.
However, this only pulls out the spelling errors, i.e. geographical errors, not the grammatical errors.

Maybe you know VB well enough to tell me what the script should look like.
Another thing that bothers me is that an extra document is always opened (in the code above). How would I have to rewrite it to append the errors below the existing text?
Thank you a thousand times!


2016-01-07 12:57:12

David Prout

I am trying my hand at proofreading and came across your GetSpellingErrors macro listed below which I am finding very helpful.

Sub GetSpellingErrors()
Dim DocThis As Document
Dim iErrorCnt As Integer
Dim J As Integer

Set DocThis = ActiveDocument
Documents.Add

iErrorCnt = DocThis.SpellingErrors.Count
For J = 1 To iErrorCnt
Selection.TypeText Text:=DocThis.SpellingErrors(J)
Selection.TypeParagraph
Next J
End Sub

I can think of a few things that could help me but I am hopeless with Word Vba. I think some of my suggestions are possibly easy and wonder if anyone can help please


It would help me if each error could be sequentially numbered. I find sometimes word underlines a word that is not a spelling error but the word may be used several hundred times in the document. This is making it difficult to find the example that is highlighted. Numbering would help locate the problem

If the count problem is difficult would it be possible to add the page number where the error occurs. This would be very useful

I am wondering if the opening of two word documents at the same time would be partly responsible for the length of time that the macro takes to run. 15-20 minutes is about the average and I am suspicious that these take up a lot of memory. Could the output be sent to a specified unopened text file to minimise the time being taken to process the macro

Thanks


2015-07-30 07:55:26

Harpreet

Many Thanks for this code..It is very useful for my typing practice in word...


2015-05-27 16:53:22

Janine manville

Is it possible to do this for the context spelling errors, ie correct spelling wrong context?


2015-02-09 08:42:12

JD Chinga

Very useful tip, many thanks.


2014-12-11 10:41:05

David Prout

I have just found the GetSpellingErrors macro, it generally works very well. For some reason it seems to be picking some words incorrectly. e.g. in a 385 page document I was analyzing it picked out the word "on". To find that error I had to use the "Find" to go through but of course it picks up every occurrence including Son,won, gone etc. This would take forever to find as there are many "Finds" on every page. I used several dodges and eventually found the error but it still took time.
Three questions.
1. Would it be possible to print the page location with the text.
2. Would it be possible to improve the highlight so it would easily be seen. e.g. color the background or change Font color of the word
3. The example I gave above was a grammar error, Would it be possible to search only spelling problems not grammar


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.