textbox spell check

R

Ray

how can i spell check a textbox on a userform in an Excel macro.

TextBox1.CheckSpelling "CUSTOM.DIC", False, True, 1033

does not work

and this form

A = Application.CheckSpelling(cWords, CustomDictionary:="CUSTOM.DIC",
IgnoreUppercase:=False)

just tells me if the word id good or not.



Ray
 
S

Shaka215

how can i spell check a textbox on a userform in an Excel macro.

TextBox1.CheckSpelling "CUSTOM.DIC", False, True, 1033

does not work

and this form

A = Application.CheckSpelling(cWords, CustomDictionary:="CUSTOM.DIC",
IgnoreUppercase:=False)

just tells me if the word id good or not.

Ray

Try this...

Inside of your spell check button on the userform...

Sheets("Sheet1").Range("A1").Value = TextBox1.Value
Sheets("Sheet1").Range("A1").Select
Application.CheckSpelling
TextBox1.Value = Sheets("Sheet1").Range("A1").Value

It's worked for me in the past...hope it works for you =)

~Shaka
 
G

Guest

A good idea, but using Application.Checkspelling throws an error when I try
it. According to help, application is used when you want to test a word, and
thus the word argument would be required. I think you need to specify the
range:

With Sheets("Sheet1").Range("A1")
.Value = TextBox1.Value
.CheckSpelling
TextBox1.Value = .Value
End With
 
R

Ray

well here is what i was trying.

i have and excel macro(program).
it can send "Can Emails" to anyone in a list with the selection of their
name on a spread sheet,
and the click of a command button. these emails can be a combo HTML and
plane text.
using DHTMLEdit to split the HTML and text apart so CDO can send it.
all that works good.

the program also uses another userform with DHTMLEdit one it.
i use this to name up new email messages.
in the DHTMLEdit i want to add spell check, much like outlook express does
on send.
sounds easy, outlook express does it, Excel can Spell Check, and i don't
want to load Word for it.
problem is, DHTMLEdit does not support spell check, or i have not found it
yet.
so i can get the DOM.interHTML and go thru it to find each word.
two problems come from that.
i can't show in the DHTMLEdit screen where the bad word it,
and i can replace it without changing the source and re-inputting it back
into DHTMLEdit

and right now, the putting each word into a cell on a spread sheet(remember
i am on a user form) to test this
and looking back at the cell to see the word was changed takes to long.
 
G

Guest

My interpretation of Shaka's suggestion is to dump the entire text from the
textbox into an empty cell, spell check that cell, then bring the entire text
from the cell back into the textbox - not to transfer/spell check your text
one word at a time. On my machine (XL2000) it appears a single cell can hold
32,767 characters - I would think that s/b enough for whatever text you may
have in a userform textbox.

Based on VBA help, CheckSpelling applies to Application (a single word), a
worksheet, range, or chart object. It doesn't look like this method can be
used directly on a texbox in a userform (but I've never explored this much
before tonight).
 
R

Ray

I'll try that,
only problem is.
my text stream has HTML in it.
my little sub skip's over the HTML tags and gives me a word at a time.

I guess,
this is why it's called VBA and not VB.
we are working with a limited subset.
and in office 2000 it was not thought to be important.

thanks

Ray
 

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