Re: Spell checking textbox on a userform
- From: "Jon Peltier" <jonxlmvpNO@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 08:44:20 -0500
Dale -
It was a while back. I think I was doing something like instantiating Word,
moving the word window off screen, copying the text into the word document,
and running Word's spell check. The spell check dialog opened in the middle
of the screen (by itself or through some windows magic, I don't recall), and
showed the typo and the surrounding text, as well as suggested spelling.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______
"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:E3518804-8DD3-4E89-B0F8-2388691C409C@xxxxxxxxxxxxxxxx
Thanks for your ideas guys.
I'll play around with it and see what happens. Jon, do you recall, did
you
instantiate Word(hidden), copy the text from the textbox into a Word
document, run the Word spell checker, if a misspelling is found, make Word
visible, then, if there were changes, copy the text back, then close Word.
That is what I am thinking of doing.
You gotta wonder why the objects and methods available to the various
elements of Office are not more tightly coordinated (methods available in
one
but not in another, or the method names are different but the functions
are
similiar). As I've gotten familiar with Excel's object model, things are
getting easier, but the range and name of functions and methods is what is
really getting to me.
Let me step down off my soapbox. Have a nice day.
--
Don''t forget to rate the post if it was helpful!
Email address is not valid.
Please reply to newsgroup only.
"Jon Peltier" wrote:
Several years back (deep in the archives), I found and customized an
example
from the web that actually instantiated Word to spell check a userform's
textboxes. It showed the highlighted and misspelled word in context of
the
whole text of the textbox, and provided suggested alternatives, just like
Word does. You could Google the words 'Word spell check in Excel', and
probably find the same initial source I had used.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______
"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:uuSdcibMIHA.4272@xxxxxxxxxxxxxxxxxxxxxxx
Chip,
If I pass this a string (a paragraph), it tells me I have a
misspelling,
but not where it is in the string and doesn't offer any opportunity to
fix
the misspelling. Using the Range object, one of the options is
[AlwaysSuggest], which at least pops up the corrections dialog. I saw
some
code on one of the sites I searched that parsed the paragraph into
single
word strings, then ran this code on the string. But I wanted the user
to
see the word that was misspelled highlighted in the textbox, like it
does
in Access or when you run spellcheck against a Word document. Doesn't
look like that is going to work in Excel; or if it is going to work, I
am
going to have to step through the textbox, selecting a word at a time
and
then run the application check spelling against it, but won't be able
to
get the suggested spelling dialog.
Dale
"Chip Pearson" <chip@xxxxxxxxxxxx> wrote in message
news:752F5C1A-9C86-4DF6-BB06-8DC72ABF34EF@xxxxxxxxxxxxxxxx
You don't have to use a Range. In the code below, put the value whose
spelling you want to test in the variable S.
Sub AAA()
Dim B As Boolean
Dim S As String
S = "coment"
B = Application.CheckSpelling(S) '<<< See help for options
If B = True Then
Debug.Print S & " is properly spelled."
Else
Debug.Print S & " is misspelled."
End If
End Sub
--
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
"Dale Fye" <dale.fye@xxxxxxxxxx> wrote in message
news:5F41169A-D2B3-49BD-92B3-E9D7C743E92A@xxxxxxxxxxxxxxxx
I'm interested in implementing spellchecking on a userform.
I have several textboxes that a user types into which are eventually
written
to cells in an underlying spread***. I've implemented a very
rudimentary
spell checker which fires on the right click in the cell. But I have
a
couple of issues with this.
1. The other CheckSpelling method only appears to work with a cell
range,
so I have to point to a cell to be checked. So when a word the
spellchecker
thinks is not valid, is found, the user cannot see this word
highlighted
within the text of the textbox because the work*** where the text
is
stored
is hidden. In Access, I would hilight the text programmatically, and
use the
docmd.RunCommand method to run the spell checker, which would
highlight
the
misspelled word and make recommendations. Is there any way to
accomplish
this in Excel?
2. When the spell checker is done checking the range (individual
cell
actually) I have pointed it to, it asks if I want to continue
checking
at the
beginning of the ***, which I don't want to do, and don't want to
see.
I'm
sure I could turn off the warnings before this line and turn them
back
on
again after, but what effect would doing so have on the spell
checker?
Dale
--
Don''t forget to rate the post if it was helpful!
Email address is not valid.
Please reply to newsgroup only.
.
- References:
- Spell checking textbox on a userform
- From: Dale Fye
- Re: Spell checking textbox on a userform
- From: Chip Pearson
- Re: Spell checking textbox on a userform
- From: Dale Fye
- Re: Spell checking textbox on a userform
- From: Jon Peltier
- Re: Spell checking textbox on a userform
- From: Dale Fye
- Spell checking textbox on a userform
- Prev by Date: Re: Pulling Data from Web Automatically
- Next by Date: Re: STILL_ACTIVE
- Previous by thread: Re: Spell checking textbox on a userform
- Next by thread: Problem with transfert between Sheets
- Index(es):