ActiveX Controls and Spell Checker

R

Rosiewednesday

Hello all,

I have created a document using ActiveX Controls in a text box. I did this
so I could limit the number of characters typed into the form. I've tried
running the Spell Checker macro that was given on Microsoft's site from MVPs
(I couldn't get this to work at all- not quite sure what to delete from the
site to VB), and this macro:

Sub SCForm()
ActiveDocument.Unprotect
Selection.WholeStory
Selection.LanguageID = wdEnglishUS
ActiveDocument.CheckSpelling
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub


It now checks the spelling in the form fields, but still not in the ActiveX
text box. Help!

Thanks,
Rosie
 
R

Rosiewednesday

What if I unprotect the document? I can't get it to spell check in that area
still, but is there anything I could do in this situation? I actually think
it would be better to have it unprotected. Doesn't the character count
feature still work when the document is unprotected? That's really all I
need.
 
C

Cindy M.

Hi =?Utf-8?B?Um9zaWV3ZWRuZXNkYXk=?=,
What if I unprotect the document? I can't get it to spell check in that area
still, but is there anything I could do in this situation? I actually think
it would be better to have it unprotected. Doesn't the character count
feature still work when the document is unprotected? That's really all I
need.
The spell-check will not work in the ActiveX controls in any case. The reason is
that the text area provided by the ActiveX control is not actually part of a
Word document. It's a separate "program" running outside of Word. Very much like
embedding an Excel spreadsheet in a Word document - everything done in the
worksheet is actually taking place in the Excel application's "domain".

Theoretically, you could write program code to use Word's spell checking engine
within your ActiveX controls. But you couldn't get the squiggly lines or the
built-in dialog box, or the right-click menu...

For spell check to work you'd have to use form fields (that's what the MVP macro
was designed for). You can limit the number of characters for a form field text
box, in the Properties.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
R

Rosiewednesday

Thanks for the tip. I have follow-up questions concerning that now. I've
inserted a Legacy Form fields text box. It won't spell check this.
Everything else I have in the form is a RichText content control, and it's
spell checking that with the macro once protected. So I tried inserting a
RichText content control into the Legacy form field. It won't spell check
that either (but it's doing everything else). It's worked maybe once out of
the 50 times I've tried it, and I'm not sure what I did to make it different
those times. It seems like it's just hit or miss.

I'm not even really sure what the difference between regular text/richtext
is, or legacy form fields vs. these content controls. I just need to get
this spell checker to work WHILE limiting characters. It seems to be an
impossible task...
 
C

Cindy M.

Hi =?Utf-8?B?Um9zaWV3ZWRuZXNkYXk=?=,
Thanks for the tip. I have follow-up questions concerning that now. I've
inserted a Legacy Form fields text box. It won't spell check this.
Everything else I have in the form is a RichText content control, and it's
spell checking that with the macro once protected. So I tried inserting a
RichText content control into the Legacy form field. It won't spell check
that either (but it's doing everything else). It's worked maybe once out of
the 50 times I've tried it, and I'm not sure what I did to make it different
those times. It seems like it's just hit or miss.

I'm not even really sure what the difference between regular text/richtext
is, or legacy form fields vs. these content controls. I just need to get
this spell checker to work WHILE limiting characters. It seems to be an
impossible task...
Are we talking now about the MACRO spell checker, or Word's built-in tool?

The latter will not work on legacy form fields. If you use those you must use
the macro.

I suppose it would be possible to limit the number of characters in a content
control using a macro, that triggers when the field is exited. IOW, it won't
stop the user from typing the extra text, but it won't keep it (or allow the
user to exit, or whatever).


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
R

Rosiewednesday

We are talking about the Macro. I am using the Macro, and it is spell
checking everything but the form field that is character limited. How can I
fix this?
 
C

Cindy M.

Hi =?Utf-8?B?Um9zaWV3ZWRuZXNkYXk=?=,
We are talking about the Macro. I am using the Macro, and it is spell
checking everything but the form field that is character limited. How can I
fix this?
I suggest you take this problem to the "Word Programming" newsgroup where
you'll get better macro support than here, in this end-user newsgroup. You
should also find people there who are more familiar with how this code is
designed to work.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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