Error in Spell Check Macro

M

miChele

I have read all the posts re using the Spell Check Macro for forms/protected
documents several times, and have tried to set up the macro several times.
In testing the macro (using the Run Sub feature in Visual Basic) am receiving
the following error msg, Compile error: sub or function not defined, when
system reaches the following line of code: Call
CheckProtectedSection(oSection). Assistance would be most appreciated.
Thank you!
 
J

Jay Freedman

Did you copy *all* of the code from the web page and paste it into the
VBA editor in your template? And did you delete the lines from between
the subroutines (which appear in red in the editor, and would cause
syntax errors)?

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
M

miChele

I thought I had, but in doublechecking again (sometimes a fresh perspective
and a little sleep AND help from a professional makes all the difference), I
had left off the last subroutine. In testing the form, I note that the
macro is correcting as I type, but is not picking up on some words, such as
"this" being misspelled as "ths". Is there a way to set the macro to
underline words it does not find in the dictionary? The purpose of this
macro is to check a comments section of a form that will become part a
permanent part of personnel files for employees, so we want the information
to be as correct as possible.

This is an awesome service! Thank you SO much for your quick response and
continued assistance!

miChele
 
J

Jay Freedman

I'm glad you could get the macro working.

I see something in your question that makes me think you have a wrong
idea of what the macro does. You said "I note that the macro is
correcting as I type, but is not picking up on some words". The macro
does *not* correct anything as you type.

If you're seeing mistakes being corrected automatically as you type,
that's coming from the AutoCorrect feature, which has a separate list
from the spelling checker. (In the default list, AutoCorrect has an
entry for "thsi" but not for "ths". You can add one if that's a common
typo in your office.) The background spell-checking that makes the
wavy underlines doesn't work in protected forms.

The macro is a replacement for the Tools > Spelling & Grammar (F7)
command, the whole-document check that runs only when requested.
That's why item 3 at the bottom of the article talks about replacing
the menu item and/or toolbar button with ones that call the macro.
When you run the macro, it will display the Spelling dialog if there
are any unrecognized words.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
M

miChele

I used the wrong terminology when explaining what was occuring when the macro
ran; I do understand that the macro itself isn't doing the spell-checking.
My bad...thanks for noting and being so thorough as to make sure I'm on the
right track. I appreciate your suggestion to add words to the AutoCorrect
list. I really appreciate your assistance!

miChele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top