Spellchecking a document with protected sections

G

GordonM

I raised this question on 4 July, but I would like to describe the situation
more completely in the hope that I may receive more replies ... nothing has
been suggested in the earlier thread in several days.

I am trying to allow spellchecking in a document that includes protected and
unprotected sections. This document was originally created as a .doc file.

I have looked at the macro in
http://word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm and tried the
example at the end of the article. This example works in my Word 2003,
checking spelling in both protected and unprotected sections. BTW, I note
that the article says:

3. To make it seamless to the user, you could assign your macro to a
toolbar button, and to a menu button on the Tools menu , replacing the
existing spellchecking buttons with yours.

I don't understand why this would be needed, as the normal Tools/Spelling
and Grammar option works just fine for this example.

The steps I have taken with my document are as follows:

1. I have opened my .doc document, setting it as unprotected.
2. I have created a new macro, pasting in the macro code from the MVP article.
3. I have returned to my document view and protected my document (for
filling-in forms)
4. I have noted that, if I place the cursor in an unprotected section,
Spelling and Grammar works.
5. If I place the cursor in a protected section, Spelling and Grammar is
greyed out ... so I cannot spell check the protected sections. This is
different to what happens for the MVP example file.

Note that, after applying the macro, I have also tried saving my document as
a .dot file and then opening it (double-clicking in Explorer) in the same way
as for the MVP example file. There is no difference in the behaviour, I
still cannot spellcheck the protected sections.

I don't understand why the example file works, but mine does not.

My apologies for what may be a duplicate post, but I am just running out of
ideas to solve this problem.

Thank you
Gordon
 
J

Jean-Guy Marcil

GordonM was telling us:
GordonM nous racontait que :
I raised this question on 4 July, but I would like to describe the
situation more completely in the hope that I may receive more replies
... nothing has been suggested in the earlier thread in several days.

I am trying to allow spellchecking in a document that includes
protected and unprotected sections. This document was originally
created as a .doc file.

I have looked at the macro in
http://word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm and
tried the example at the end of the article. This example works in
my Word 2003, checking spelling in both protected and unprotected
sections. BTW, I note that the article says:

3. To make it seamless to the user, you could assign your macro to a
toolbar button, and to a menu button on the Tools menu , replacing the
existing spellchecking buttons with yours.

I don't understand why this would be needed, as the normal
Tools/Spelling
and Grammar option works just fine for this example.

Of course it does, this is because what is being described in step #3 has
been done in the example. It has been made to appear seamless to the user,
and, in this case, to the developer!
The steps I have taken with my document are as follows:

1. I have opened my .doc document, setting it as unprotected.
2. I have created a new macro, pasting in the macro code from the MVP
article.
3. I have returned to my document view and protected my document (for
filling-in forms)
4. I have noted that, if I place the cursor in an unprotected section,
Spelling and Grammar works.
5. If I place the cursor in a protected section, Spelling and Grammar
is greyed out ... so I cannot spell check the protected sections.
This is different to what happens for the MVP example file.

Note that, after applying the macro, I have also tried saving my
document as a .dot file and then opening it (double-clicking in
Explorer) in the same way as for the MVP example file. There is no
difference in the behaviour, I still cannot spellcheck the protected
sections.

I don't understand why the example file works, but mine does not.

Because you have not removed the built-in button/menu choices to replace
them by your own, as is suggested in step #3 of the web page you quoted at
the top.
Basically, you add a button on the toolbar next to the built-in one (use the
information you get when you click on "assign your macro to a toolbar
button, and to a menu button on the Tools menu" in the step #3 paragraph.
Then, right-click the built-in button (when in Customization mode) and copy
the button face. Next, right-click your button, paste the button face.
Finally, remove the built-in button. All this is best done in a template
from which documents will be created. You could do it with a document, but
it is sometimes flaky.

Repeat with the menu (Tools > Spelling and Grammar...).

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

GordonM

Thank you for the reply. So what I am seeing as a non-greyed-out "Spelling
and Grammar" item is, in fact, a replacement of the original and this was
carried in by the example file. Would this be through Normal.dot, do you
know?

Thank you
Gordon
 
J

Jean-Guy Marcil

GordonM was telling us:
GordonM nous racontait que :
Thank you for the reply. So what I am seeing as a non-greyed-out
"Spelling and Grammar" item is, in fact, a replacement of the
original and this was carried in by the example file. Would this be
through Normal.dot, do you know?

Yes, I Know. No, it is not in Normal.dot.

Good code never touches Normal.dot.

If you noticed, what you downloaded in the zip file from the Word MVP FAQ
site is a template, not a document. The button changes was done in that
template.

For more information on template and ,macros, you should have a look at:
http://word.mvps.org/faqs/customization/CreateATemplatePart1.htm
http://word.mvps.org/faqs/customization/CreateATemplatePart2.htm
http://word.mvps.org/faqs/macrosvba/DistributeMacros.htm
http://word.mvps.org/faqs/Customization/WhatTemplatesStore.htm

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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