Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Spell Checking Forms.

Spell Checking Forms

by Allen Wyatt
(last updated December 9, 2015)

9

Many people use Word to create forms that are then used by others to input information. I am not talking about your average, run-of-the-mill forms which are printed out and reproduced on a copier. I am talking about using forms with Word's special form fields that are used to collect specific data without allowing the user to modify the text surrounding the input fields.

Since these types of forms are protected, by design, the user cannot run certain Word tools on the form and cannot do other things, such as run macros. This is beneficial in many instances, but can be a drawback if you have special needs. One such common need is to run the spell checker on the form after the user inputs their information. However, this cannot be done, again because tools such as the spell checker are disabled.

Truth be told, however, and you will find that when you insert a form field, Word inserts it with the Language attribute set to "no proofing." This means that even if you could run the spell checker, Word would ignore the information typed into the form fields.

While this may sound a bit hopeless, there is a way around it. You can run the spell checker on your form by using a macro. The simplest way to do this is with the following macro:

Sub SCForm()
   ActiveDocument.Unprotect
   Selection.WholeStory
   Selection.LanguageID = wdEnglishUS
   ActiveDocument.CheckSpelling
   ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub

Note that the macro sets the Language attribute for the entire document to US English. If you are creating forms in some other language, you should make sure that you change the macro so the appropriate language is selected.

When you are making the form, define a style for the input fields. The key attribute of the input field style is that you have to explicitly disable the do not check spelling attribute by following these steps:

  1. Define the field you want to use for your input fields, as described in other WordTips.
  2. Display the Home tab of the ribbon.
  3. Click the small icon at the bottom-right of the Styles group. Word displays the Styles task pane.
  4. In the list of styles shown, hover the mouse pointer over the name of the style you created in step 1. A drop-down arrow should appear at the right side of the style name.
  5. Click the drop-down arrow and choose Modify. Word displays the Modify Style dialog box. (See Figure 1.)
  6. Figure 1. The Modify Style dialog box.

  7. Click on Format and select Language from the pull-down list. Word displays the Language dialog box. (See Figure 2.)
  8. Figure 2. The Language dialog box.

  9. Make sure the Do Not Check Spelling or Grammar check box is selected.
  10. Click on OK to close the Language dialog box.
  11. Click on OK to close the Modify Style dialog box.
  12. Apply the new style to all your input fields.

There is a drawback to this macro which may not make it acceptable for all uses. When run, the macro spell checks everything in the document, not just the contents of the form fields. This is only a drawback if the form has lots of words which the spell checker may consider misspelled, such as highly technical prose. If you find yourself in such a situation, you will need to create a more complex macro that actually searches for and steps through the fields in the form or you could arrange to add the word to the dictionary file.

There are two things to remember when using this macro with a form:

  • Make sure you associate this form with the template that contains your macro.
  • You will need to assign the macro to the Quick Access Toolbar. This is the only way it can be run. Remember that you cannot access the Macros control when filling in a protected form.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9445) applies to Microsoft Word 2007 and 2010. You can find a version of this tip for the older menu interface of Word here: Spell Checking Forms.

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

Forcing Manual Calculation For a Workbook

If you have a large, complex workbook, you may want to make sure that it is always calculated manually instead of ...

Discover More

Converting Radians to Degrees

When applying trigonometry to the values in a worksheet, you may need to convert radians to degrees. This is done by using ...

Discover More

Quickly Inserting a New Worksheet

Want a quick way to insert a worksheet? There's nothing faster than using the handy shortcut.

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 (ribbon)

Converting Forms to Regular Documents

Word allows you to protect documents that are intended to be used as forms. If you want to convert the form responses back to ...

Discover More

Entering a Name in the Header of a Locked Form

When you lock a document as a form, then Word limits what you can do with that document. That includes not being able to ...

Discover More

Stopping Enter from being Pressed In a Form

If you create a form using Word, chances are good that you don't want a user to mess up the layout of the form by pressing ...

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. 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 4 + 7?

2016-06-10 07:17:05

Margaret

I like the simplicity of this code. It works for me except it that it's not checking grammar along with spelling. I made sure under Options that grammar was selected to be checked along with spelling and I made sure to uncheck "Do not check spelling and grammar" under Languages.

I added the below line to specifically check grammar too (see below) and it works great in Word 2010 but not in 2016.

ActiveDocument.CheckSpelling

Anyone have any idea why?


2015-08-31 09:27:50

Dan

Carol is correct, the "Do not check spelling or grammar" box should actually be *deselected* when defining the style.

@awyatt could you correct instruction #7 to reflect this?


2015-07-13 12:40:49

awyatt

Linda: I (Allen Wyatt) run the site, so I guess I'm the "host." I don't answer every question; I can't. (There are thousands of articles on this site, and many have very lively comment discussions.)

The comments are here so that people can discuss amongst themselves. Sometimes you'll find answers to questions posed in comments; sometimes you won't -- it all depends on if people choose to continue the conversation or not.

Understand, though, that since there are thousands of articles here, questions may be answered in other articles. Easiest way to find the articles is to use the search box at the upper-right of any page.

Best of luck to you!

-Allen


2015-07-13 12:26:21

Linda

Where does one find answers to these questions other users have posted? Is there a host for this site?


2014-08-14 04:28:44

John

I have a similar issue to Deena, above. If I create a Style for merge fields, would that Style transfer with the template to another user's machine? If I went the macro route, how do I include the macro in the template so that it is useable for other users utilizing my template?


2014-04-15 15:35:35

Deena

I have many form fielded, protected documents that I need to share with hundreds of people. I would like them to be able to spell check but not have to load the macro, is there any way to do embed the macro in the document so they can just hit the button and run spell check?


2013-12-18 13:17:24

Carol

Why create a style that has the box checked "Do Not check spelling or grammar" when wanting to do a spell check? This seems like it is the opposite of what it should be. What's up?


2013-02-13 17:55:38

Lisa

Yeah, this isn't working for me either. :(


2013-01-16 12:05:33

luke

Hello.

When I run this, it doesn't spellcheck the form fields, though it does spell check everything else. Any idea what I've done wrong, please?


This Site

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

Newest Tips
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.