• Spell Checking Form Fields

    Author
    Topic
    #352517

    I put your code into a global template and with your permission (and that of Dave Rado) I will post it on my website as freeware at: http://www.addbalance.com/word/download/index.htm%5B/url%5D They may want to post it on the MVPs site as well.

    I’ve attached my draft (zipped file). Thoughts?

    Viewing 1 reply thread
    Author
    Replies
    • #513004

      Charles,

      OK with me- my only problem is I didn’t get Dave’s permission for posting it here. Oh dear.

      I’d just like to have people check that it works, and to correct problems.

      • #513225

        I have checked it, in Word 97 and Word 2000, on unprotected documents, completely protected documents, partially protected documents, and protected documents with passwords. The only problem I ran into is that you need the password to check documents that have a password.

        That can be handled in the code if it is put into the individual template or document. I still haven’t heard anything from Dave Rado, but I doubt that he will be miffed so long as the source was acknowledged.

        • #513238

          Chas,

          Sounds good. Thanks for that. I appreciate the feedback.

          I have contacted the MVPS site. I haven’t heard back yet.

          The only thing I should add is that it’s not just Dave Rado, but Bill Coan, Astrid Zeelenberg and Dan Monk

    • #512981

      Hi,

      I’ve had users who have landed themselves in all sorts of trouble when the unprotect a protected form to spell check it, and then reprotect it (or even print it with the “Tools, Options, Print” and “update fields” checked).

      I’ve put this in here rather than the VBA site because I thought it might help fill a wider need than just for VBA programmers.

      Some time ago I came across some code in the Microsoft Word MVPS site which did check form fields.

      I felt it needed som expansion- because it did not spell check unprotected sections in a protected document.

      So I’ve hashed it around a bit. The hard bit had already been done by Dave Rado, so it wasn’t too much of a job.

      This is my code- I’d certainly welcome feedback, particularly where I’ve made glaring errors or ommissions.

      I’m enclosing it in tags to preserve formatting- but it anybody wants to cut and paste, I’ve also attached the same in a txt file.

      ********* Edited Geoff W 15 Feb **********

      I’ve edited this to remove the code. Dave Rado has reworked the code on his site, and has improved my version.

      At his request, I’ve removed the original code, and pointing at the Microsoft Word MVPS site

      • #513005

        Hi Geoff,
        This is just a thought – I don’t know if it would speed the code up unless you had a lot of sections – but there are a number of references to ActiveDocument so I’d probably use
        With ActiveDocument
        End With
        particularly as two of them are within a For…Next loop.
        Any thoughts?

        • #513158

          Rory,

          Point taken. Thanks.

          I should also make the “internal” routines private so they don’t show in macro dropdown lists.

      • #513157

        Hi,

        I thought after I posted it would have been better to put this posting in a way which could be used by anyone who didn’t know VBA.

        As a bonus, this document also includes replacement for the “protect forms” which does NOT reset data whe you protect a document for forms- something I’ve always found a big nuisance. It’s completely transparent- and allows all normal protection to work (eg for revisions; put in passwords).

        To set this up, copy the attached “SpellCheck.dot” into your startup directory (You can find that by Tools, options, file locations, startup). Restart Word.

        The “new” spellcheck, for checking protected forms, is available from the red tick spelling check. The protection is available through the normal methods.

        If anybody uses this, I’d appreciate feedback, good or bad.

        • #513359

          Geoff,

          You might want to alter your attachment a bit.

          1) consider putting it in a zip file. Otherwise, for me, the template opens in my Internet Explorer. Also, Word documents (including templates) tend to have strings hanging out that get clipped off over the Internet by the mail handlers. Zipping the file tapes all of these strings down inside the package so they don’t get cut off.

          2) don’t protect the template for forms (or at least not with a password) if you want to give people access to the code.

          • #513361

            Chas,

            1. A word doc opens in my IE too- but that hasn’t been a problem. I can save it and open it in Word if I want. I’m not sure what you mean by strings though.

            But a zip file should be OK.

            2. I’ll unprotect it- but it didn’t have a password. Even with a password on the form, that doesn’t keep you away from the code- that’s still open.

            BTW, I’ve had some feedback from Dave Rado with a few usefule points- I will be clarifying some of them.

        • #513566

          *** This was posted by mcarpent99 as a new thread- I’ve brought a copy over to this thread where it applies ***

          I am struggling with spell checking in protected forms and downloaded and saved your SpellCheck.dot file to the right location and after restarting Word I do get the red check mark on my tool bar. When I click it though, it ignores errors and says it is complete. The only time it noted an error was on a Grammar check on a misspelled word suggesting a capital letter for the beginning of a sentence.

          I have since gone to Tools | Options and Check Document with the same result.

          Any help will be greatly appreciated!

          • #513571

            This is really me repplying to mcaprpent’s post which I copied!

            I’ve had no trouble with this, and had no trouble with the document which was attached.

            A general question, not to MCarpent- Is there something more general which tells Word that a document is checked? I’ve had that happen, apart from this macro- I presume it had been checked previously, and Word had marked it as checked. When I make changes to the document, it checks OK.

            Is this the case? If so, can I force the spell checking to happen?

            • #513585

              Geoff,
              If you open the spelling options page, the Recheck document button should reset it.
              If you are looking to add this to your macro, look at the properties
              SpellingChecked and ResetIgnoreAll

              From Help:
              Application.ResetIgnoreAll
              ActiveDocument.SpellingChecked = False
              ActiveDocument.CheckSpelling

            • #513594

              Thanks James,

              Those lines of code were in the macro (as copied from the MVPS site), so that doesn’t solve the problem as raised by mccarpent. It does help me to understand the code from the mvps site better though!

              Davr Rado actually suggested that the “Application.ResetIgnoreAll” should not be used as a matter of course. If a user chose to ignore all occurrences of a word, and then rechecked the document, they may be annoyed at having to check the same words previously marked as “Ignore”.

          • #513589

            Hi there Geoff! I hope I’m understanding correctly – spell check won’t? [Boy, this is a LONG thread!]
            I’m not conversant with VB code but when I opened your attachment I noted that the language was set to ‘None’. When I changed the language to English (Australian)and then ran spell check, the typos were picked up by spell check.

            • #513595

              Patricia,

              This is not a long thread- there’s a lot longer in the Excel forum, for instance.

              OK, that looks as if it could be the problem.

              I had a line of code which set the language to the language of the attached template. I probably need to add to that code which forces a language if there is none attached.

              ** edit- new line added: **
              In fact, if the language ID does not exist for the attached template, first check normaltemplate before forcing a language **

              Thanks!

            • #513599

              Wow! You are so right about longer threads. I just hopped over to the Excel Board to check it out.
              I’ve learned a lot just lurking around the Outlook & Word boards and since Excel is my BIGGEST weakness I now know where to find expert help in the form of a search or posting a query. Cheers!

            • #513749

              Will you be adding changes and republishing? I’m afraid I am lost as to the changes that need to be made with the new information.

            • #513834

              Hi,

              I haven’t completed the changes, as I’m unsure of one thing, and I need some feedback.

              It looks as if people who don’t have a language ID set up cannot spell check. I’d like to test for this condition, but I cannot reproduce it.

              Can someone who has had this probleam run the attached template and let me know the values in the message please?

              Thanks very much

      • #514697

        Hi,

        Note that I’ve changed to original post, at Dave Rado’s request, and replaced it wirh a link to the new improved code at Microsoft Word MVPS site

        • #524921

          Hi,

          I’m a freelance art director, working in the Boston, MA area. I’ve created a bunch of Mac Word 98 forms for an ad agency in town. But I didn’t realize that you can’t spellcheck protected forms. Which is a problem. In researching the problem, I got as far as this message board and the updated macro code at http://www.mvps.org/word/FAQs/MacrosVBA/Sp…kProtectDoc.htm

          But when I try to follow the instructions I get a general syntax error message. I’m wondering if this is PC code rather than Mac code? Or maybe it’s code for Word 2000 rather than 98?

          Does anyone have hints on creating this macro on the Mac for Word98?

          Thanks in advance!

          jt

          • #524955

            Judith,

            I probably can’t help you- but in case somebody else can- what was the syntax error message you had? Did it point to a particular line of code?

            Your other approach for spell checking forms- which is useful only if what’s to be filled in occpies a whole line- is to include the area where text is to be filled in within section breaks, and when protecting the form, leave that section unprotected (Tools, protect document, forms, click on sections). It’s not as nice as form fields, because users cannot see the cursor, and the tab key inserts a tab instead of going to the next form field. There’s ways around that to some extent, but it’s not as clean as just putting in a form field.

      • #540331

        Hi Geoff,

        I was hoping that you might be able to help me out with a problem I am experiencing with Dave Rado’s code on the MVPS site. After searching high and low for just such a solution to spell checking protected form fields, I came across your posting and it appeared that my search was over.

        However it seems that it is doing something quite strange when the macro code is run. I have created a couple of templates which have 2 sections to them. The first section contains form fields and is protected. The second section is plain text, unprotected. When the Spell Check macro is run it successfully checks a couple of the protected fields in section one, then moves on to successfully check all of the text in section 2. It does, however, leave a couple of fields unchecked in the first section. If I run the macro again, it picks up all errors in all fields and text with no problems.

        Could you shed any light on why the code is not checking all of the fields on the first run? All of the fields are formatted the same (normal text) so I can see no reason for this inconsistency, even with my extremely limited experience with VBA.

        Any help would be very welcomed.

        Barry Green

        • #540692

          Please ignore my request for help in the previous post.

          I noticed that Charles Kenyon advised that there was an update to the Spell Check code on the MVPS site in his latest update New on the Word MVP FAQ Page and tried that out on the templates I have been making.

          All is now right with the world, and all fields are being checked for spelling every time the macro is run. smile

          Thanks very much to all the Loungers who have submitted to this thread, you have saved me from many headaches in this task. thumbup

          Cheers,

          Barry Green
          Australia

          • #540712

            Barry,

            Whoops- sorry, I missed your first post. I’m glad you’re up and going again though.

            Dave rado, of the MVPS site, mailed me yesterday about the spell check- see this post

    Viewing 1 reply thread
    Reply To: Spell Checking Form Fields

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: