The macro is already written? You only have to install it
Seehttp://
www.gmayor.com/installing_macro.htmwhich shows how to deploy the
code.
The original web page also shows how to add the extra lines of code should
theformbe password protected.
The code is also available from the original page in theformof an addin
for Word versions up to Version 2003 (for Word 2007, it is simpler to use
the macro organiser to copy the macros from the template to the normal
template)
Run the macro on exit from the lastformfield.
For Word 2002/2003/2007 you could use the simpler code run on exit from the
lastformfield. Add the password if any between the quotes at both places
it says
Password:=""
Sub SpellCheckForm()
Dim i As Integer
Dim bProtected As Boolean
'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If
'checkeach formfield for spelling
For i = 1 To ActiveDocument.FormFields.Count
ActiveDocument.FormFields(i).Select
#If VBA6 Then
Selection.NoProofing = False
#End If
Selection.LanguageID = wdEnglishUK
Selection.Range.CheckSpelling
Next
'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
- Show quotedtext-