Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2001
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spell Check Form (Word 2000)

    I found code that allows a spell check on a protected form document. By inserting a macrobutton field in the template, when a new document is created from the template the macro can be executed to unprotect, spell check and then protect the document. However, this does not work on a table. Does anyone know where I can find information on doing a spell check on a protected form which was created in a table? Thanks. Judith

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Spell Check Form (Word 2000)

    Have you tried <A target="_blank" HREF=http://www.mvps.org/word/FAQs/MacrosVBA/SpellcheckProtectDoc.htm> Spellchecking in a protected form</A>?

    I don't know that this works in a table but most of the people who worked on it regularly use tables for their protected forms and I would be surprised if there was a problem.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. #3
    Lounger
    Join Date
    Mar 2001
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check Form (Word 2000)

    Charles, thank you so much. The code is definitely different and I will work with it as soon as we're finished with our disaster recovery issues with our New York office. Thanks very much.
    Judith

  4. #4
    Star Lounger
    Join Date
    Oct 2001
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Spell Check Form (Word 2000)

    I am using a script for this that I found on MS Knowledge Base. It worked fine in Word 97 and I made the suggested changes for Word 2000. I have the macro set to run when the user exits from the last field. The script unprotects the form, spell checks and then protects the form. What happens SOMETIMES is that when the spell check starts it might check a field or two, then asks if you want to continue. At this point whether they say yes or no they get some illegal operation and are kicked out of Word. I have added this macro to several template files. The kicker is that it might work 3 times in a row with one template and then using the same template once more will cause the failure. I actually haven't been able to see it break, but many of my users have reported it.

    I am adding the text of the script below as quoted from MS Knowledge Base Q191028.

    "...Method 3: Unprotect, Check Spelling or Update a Field, Reprotect a Document
    Because form field text is formatted for No Proofing, you can use the following macro to:
    Temporarily unprotect the form.

    Change the language of the form fields.
    Perform a spelling check or update a field.
    Reprotect the form while preserving the text you've typed into the form fields.

    You can use this macro as an On Exit macro for the last form field so you can check the spelling or update a field before you save the form.

    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

    IMPORTANT NOTE: There are some differences in Visual Basic for Applications between Microsoft Word 2000 and Microsoft Word 97 for Windows due to the Enabled Language Settings feature in Microsoft Office 2000. One of the differences is noted in the above macro. To correctly check the spelling of a document after setting the LanguageID, you must set the NoProofing property in Word 2000. "

    Thanks.

    Jane

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •