I have tried the MVP article "How to enable the spellchecker in a protected
document" contributed Dave Rado, Bill Coan, Astrid Zeelenberg, Dan Monk and
Geoff Whitfield.
The code works just fine, except for the bit to cover cases where, as they
say, "If formfield was destroyed when the user corrected the spelling,
reinstate it, and put the user's correction into its result."
The problem is this: In the Spelling and Grammer Dialog, if the user deletes
all the text in the dialog box (so that the mispelling is changed to
nothing), the macro code appears to go into an infinite loop. The only way to
shut it down is to shut down Word.
Does anyone how how to fit this?
Thanks,
Christine
P.S. I originally posted this at
http://communities.microsoft.com/newsgroups/default.asp?icp=prod_office&slcid=us
but didn't get a response. Not sure what the difference is between that site
and this one.
Jay Freedman - 18 Jan 2005 15:14 GMT
Hi Christine,
You should be able to stop any looping macro by pressing Ctrl+Break. That
opens the VBA editor in debug mode, with the highlight on the statement that
was executing when you hit the keys. You can then step through one statement
at a time by pressing F8 (or using entries on the Debug menu). You can see
the values of variables by hovering over their names with the mouse, or add
them to the Watch window by using the right-click menu.
When you do that with the spelling macro, is the highlight on the oDoc.Undo
statement in the place you indicated? If so, what are the values of
FmFldCount and oSection.Range.FormFields.Count (you'll have to use the Watch
window to get the latter one)? What happens to those values when you use F8
to go around the loop?

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
> I have tried the MVP article "How to enable the spellchecker in a
> protected document" contributed Dave Rado, Bill Coan, Astrid
[quoted text clipped - 16 lines]
>
> P.S. I originally posted this at
http://communities.microsoft.com/newsgroups/default.asp?icp=prod_office&slcid=us
> but didn't get a response. Not sure what the difference is between
> that site and this one.