When the user tries to save or close the form, the AutoExit macro could check the value of the variable, and if it shows there are mandatory fields not filled in, then a dialog box explaining the problem could be displayed.Īll of these approaches, of course, will require extensive testing before implementing. It also offers a traditional spell-check in an MS Word style. During text entry and editing, spell checking informs the user that a word is misspelled by highlighting it with a red squiggle and provides a way for the user to correct the misspelling. We also discuss some additional things you can do if this automatic spell check setting isn’t helping. Your macro, of course, could get much more specific in the checking it does.įor a more comprehensive approach, you could have the on-exit macros (if there is more than one mandatory field) set a system variable. ASP Spell Check - The Spellchecker Component for Microsoft ASP Websites and Intranets. Our article continues below with additional information on turning on spellcheck in Word 2013, including pictures for these steps. This particular example checks to make sure that the user enters something-anything-in the field. In this macro you would need to change the name of the field specified (Text1) to the name of the field you are using the macro with. SInFld = InputBox("This field must be filled in, fill in below.")ĪctiveDocument.FormFields("Text1").Result = sInFld If ActiveDocument.FormFields("Text1").Result = "" Then The following is an example of a simple macro to do just this: If not, then the macro could move the insertion point back to the field to request input, or could prompt the user for the necessary information. (Right-click on the field, choose Properties, and use the Exit drop-down list to select a macro to run.) The macro could check to make sure the value provided within the field is within acceptable bounds. Perhaps the easiest method is to simply make sure that you set the appropriate "on exit" setting for the form field to run a macro.
But there are several ways to provide the same functionality. There is no setting that you can use to mark a field as mandatory, as you can in Access. In other words, making sure that the user must fill something in the field. Julia asked if there is a way, when designing forms in Word, to make a particular form field mandatory.