There are lots and lots of folks who use Word to create forms. Those forms are then used by others to key in information. Now these are not the old fashioned forms that we once printed out, and had people write on the blank lines. What I am referring to is forms with the special form fields in Word that are used to collect 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 use Word tools on the form and cannot do other things, like run macros. Many times this is very beneficial, but it can be a drawback if you have special needs, such as running the spell checker after a user has entered information in the form. This cannot be done, again because tools like this are disabled.
You will find that when you insert a form field, Word inserts with it 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 futile, 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 macro below:
Selection.LanguageID = wdEnglishUS
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
Note that the macro sets the Language attribute for the entire document to US English. If you are creating forms in another language, be certain that you change the macro so the appropriate language is selected.
When you are making your 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.
Follow the steps below to learn how:
- Define the field you would like to use for your input fields.
- Display the Home tab of your Ribbon.
- Click the small icon at the bottom-right of the Styles group to display the task pane.
- In the list of styles shown, hover your cursor over the name of the style you created above. A drop-down arrow should appear at the right-hand side of the style name.
- Click the drop-down arrow and select Modify to display the Style dialog box.
- Click on Format and select Language from the drop-down list. Word will display the dialog box.
- Be certain the Do Not Check Spelling or Grammar check box is not selected.
- Click on OK to close the Language dialog box.
- Click on OK to close the Modify Style dialog box.
- Apply the new style to all your input fields.
There is a caveat with this macro which may not make it acceptable for all uses. When run, the macro will spell check everything in your document, not just the contents of your form fields. This is only a problem if your form has a large number of words which the spell checker may consider misspelled, such as medical terms. If you find that to be the case, you will need to create a more complex macro that will actually search for and step 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:
- Be certain you associate this form with the template that contains your macro.
- You will need to assign the macro to your QAT (Quick Access Toolbar)
Thank you to Allen Wyatt for the macro used in this article!