View Single Post
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
gchr gchr is offline
external usenet poster
 
Posts: 2
Default Spell Check in Forms

I am unable to open the link you have listed below-we have certain things
blocked & yours come up blocked-Looks like you have an advertisement for Real
Estate with that link.

"Graham Mayor" wrote:

Basically all you have to do is to copy and paste the following into your
template (see http://www.gmayor.com/installing_macro.htm ) and attach the
macro to a toolbar button. If you have any other language but English US -
change the line
Selection.LanguageID = wdEnglishUS
to reflect that.
If your form has a password, insert the password between the quotes at the
two places the password is called for

ActiveDocument.Unprotect Password:=""
and
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""

and no there is no other way to spell check a protected form.


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

'check each formfield for spelling
For i = 1 To ActiveDocument.FormFields.Count
ActiveDocument.FormFields(i).Select
#If VBA6 Then
Selection.NoProofing = False
#End If
Selection.LanguageID = wdEnglishUS
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 site www.gmayor.com
Word MVP web site http://word.mvps.org



gchr wrote:
I have a protected form set up & am unable to run spell check. I've
read over the "How to enable the spellchecker..." from MVPS. Is
there any other way of doing this? Evidently MACROS are not my
friend & I've been trying to follow the directions & have had no
sucess yet! Please help!