![]() |
Spell checking textbox on a userform
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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
Hi Dale,
I'm not clear about your request. It sounds as though you are using two different approaches to creating the spell checker. . . .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, In Excel 2000 help, I don't see a reference to cell range. How are you using this method? . . .it asks if I want to continue checking at the beginning of the sheet, 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? What is the code you're using for the rudimentary spell checker? Dan D On Nov 27, 12:34 pm, Dale Fye wrote: 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
Dale,
Did you fink the likn Jon was talking about? Could you please provide me with it? I think this apporach is better than the other than doesn't give you the option to edit the misspelled word Thanks in advance, LuisE "Dale Fye" wrote: 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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
So far I can't find the original source for my technique. The article was
based on Office 97, and while it would work fine on subsequent versions, a lot of good Office 97 content has disappeared. This short article has the gist of my approach: http://www.fabalou.com/Access/Genera...spellcheck.asp - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "LuisE" wrote in message ... Dale, Did you fink the likn Jon was talking about? Could you please provide me with it? I think this apporach is better than the other than doesn't give you the option to edit the misspelled word Thanks in advance, LuisE "Dale Fye" wrote: 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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
FWIW, the original article was in the Microsoft Office Developer's Forum at:
http://www.microsoft.com/exceldev/articles/chkExcel.htm AFAICT, it no longer exists. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Jon Peltier" wrote in message ... So far I can't find the original source for my technique. The article was based on Office 97, and while it would work fine on subsequent versions, a lot of good Office 97 content has disappeared. This short article has the gist of my approach: http://www.fabalou.com/Access/Genera...spellcheck.asp - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "LuisE" wrote in message ... Dale, Did you fink the likn Jon was talking about? Could you please provide me with it? I think this apporach is better than the other than doesn't give you the option to edit the misspelled word Thanks in advance, LuisE "Dale Fye" wrote: 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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
Spell checking textbox on a userform
Aha! This article is one edition later than the one I was citing.
http://msdn.microsoft.com/archive/de...xlchkexcel.asp - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Jon Peltier" wrote in message ... FWIW, the original article was in the Microsoft Office Developer's Forum at: http://www.microsoft.com/exceldev/articles/chkExcel.htm AFAICT, it no longer exists. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Jon Peltier" wrote in message ... So far I can't find the original source for my technique. The article was based on Office 97, and while it would work fine on subsequent versions, a lot of good Office 97 content has disappeared. This short article has the gist of my approach: http://www.fabalou.com/Access/Genera...spellcheck.asp - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "LuisE" wrote in message ... Dale, Did you fink the likn Jon was talking about? Could you please provide me with it? I think this apporach is better than the other than doesn't give you the option to edit the misspelled word Thanks in advance, LuisE "Dale Fye" wrote: 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" wrote in message ... 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" wrote in message ... 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" wrote in message ... 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 spreadsheet. 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 worksheet 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 sheet, 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. |
All times are GMT +1. The time now is 07:16 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com