Results 1 to 3 of 3
  1. #1
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    661
    Thanks
    3
    Thanked 19 Times in 18 Posts
    Hi all,

    I'm moving some very simple code from Word 2007 to 2010 and it's not working in 2010. This snippet of code will reset spell check in a document and force the user to review anything s/he has previously Ignored.

    Code:
    Application.ResetIgnoreAll
    ActiveDocument.SpellingChecked = False
    ActiveDocument.CheckSpelling
    This is the code I've been using (since Word 97, in fact). Since it didn't work in 2010 I thought perhaps MSFT changed the code, so I recorded a macro. The above is the resulting code (minus a line or two referencing Grammar), which is the same as my code. It, too, doesn't work.

    In the program help for the ResetIgnoreAll method, it gave this exact example, but the help text indicated that for the method to work you must first set SpellingChecked to False. So I reversed the first two lines and got the same result.

    To test, I spell check a document with a typo (flagged with a red squiggly underline) and tell Word to Ignore All when the typo is found. Then I run the code.

    There is no error message, it just doesn't reset the document, the typo is not re-underlined and the CheckSpelling dialog does not appear. Is it possible that this is broken in 2010 VBA? Can anyone else make this work?

    Thanks,
    Kim

    **Additional info: testing shows that this method works if you Ignore Once. It doesn't work when you Ignore All.**

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,510
    Thanks
    3
    Thanked 143 Times in 136 Posts
    You might want to add something along the lines of

    ActiveDocument.Range.LanguageID = wdEnglishAUS
    ActiveDocument.Range.NoProofing = False
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #3
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    661
    Thanks
    3
    Thanked 19 Times in 18 Posts
    Quote Originally Posted by Andrew Lockton View Post
    You might want to add something along the lines of

    ActiveDocument.Range.LanguageID = wdEnglishAUS
    ActiveDocument.Range.NoProofing = False
    Hi Andrew -- this worked and it didn't.

    I opened Word and opened my test document which had been saved with the ignored typo. I ran my code with your lines added (with wdEnglishUS) and it flagged the ignored word before it even got to the ResetIgnoreAll command. However. When I ran Spell Check again and clicked Ignore All...

    If I then run the code to Reset, nothing happens.
    If I save the document then run the Reset code, nothing happens.
    If I save the document, close it and open it, and run the Reset code, nothing happens.

    BUT. If I close Word, then open it and open the document, then run the Reset code... it works.

    This looks like a bug to me. As I said above, if I Ignore Once, this rigamarole doesn't happen -- the code works as originally written.

    Thanks,
    Kim

Posting Permissions

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