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.
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.
ActiveDocument.SpellingChecked = False
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?
**Additional info: testing shows that this method works if you Ignore Once. It doesn't work when you Ignore All.**
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.
Originally Posted by Andrew Lockton
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.