Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of Spell Check in a Form

Status
Not open for further replies.

lostAndConfused

Programmer
May 1, 2002
7
US
Hello...

I have a performance evaluation form created in Word 2000. My users want to use the spell checker while filling out the form, but it appears to be disabled when the protection is turned on.

Anyone have a solution for this?

Thanks...
 
L & C,

You could put a button on your sheet that turns off protection, performs spell-check, allows for controlled user response, and finally resets protection.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
For example...
Code:
Private Sub CommandButton1_Click()
   ActiveDocument.Unprotect Password:="x"
   ActiveDocument.SpellingChecked = False
   If Options.CheckGrammarWithSpelling = True Then
      ActiveDocument.CheckGrammar
   Else
      ActiveDocument.CheckSpelling
   End If
   ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="x"
End Sub
:)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Hi,
This works to spellcheck a protected form in Word 2000, and you can assign it to a button that appears in the document for users to click.

Code:
Sub FormsSpellCheck()

   ' If document is protected, Unprotect it.
   If ActiveDocument.ProtectionType <> wdNoProtection Then
      ActiveDocument.Unprotect Password:=""
   End If

   ' Set the language for the document.
   Selection.WholeStory
   Selection.LanguageID = wdEnglishUS
   Selection.NoProofing = False

   ' Perform Spelling/Grammar check.
   If Options.CheckGrammarWithSpelling = True Then
      ActiveDocument.CheckGrammar
   Else
      ActiveDocument.CheckSpelling
   End If

   ' ReProtect the document.
   If ActiveDocument.ProtectionType = wdNoProtection Then
      ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
         NoReset:=True
   End If

End Sub

HTH,

Best,
Blue Horizon [2thumbsup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top