Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
Kindly Make sure that you set the appropriate "on exit" setting for the form field to run a macro. (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. 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. The following is an example of a simple macro to do just this:
Sub MustFillIn()
If ActiveDocument.FormFields("Text1").Result = "" Then
Do
sInFld = InputBox("This field must be filled in, fill in below.")
Loop While sInFld = ""
ActiveDocument.FormFields("Text1").Result = sInFld
End If
End Sub
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. This particular example checks to make sure that the user enters something—anything—in the field. Your macro, of course, could get much more specific in the checking it does.
For a more comprehensive approach, you could have the on-exit macros (if there is more than one mandatory field) set a system variable. 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..
Refer here:
https://wordribbon.tips.net/T008337_Using_Manda...
______________________________________________
Standard Disclaimer: There are links to non-Microsoft websites. The pages appear to be providing accurate, safe information with reference. Thoroughly research products advertised on the sites before you decide to download and install it. Watch out for ads on the sites that may advertise products frequently classified as a PUP (Potentially Unwanted Products).