Using Words Spellcheck and grammer check with your windows Forms application

One of my customers wanted to add spell check functionality to their windows Form application.  knowing that everyone in their organization has Microsoft Office installed, I did not want to include word interop with the application. so I found a neat way of using words spellcheck. for more information you might want to check this article that was very helpful .

  Private Sub SpellAndGrammarCheck(ByVal YourTextbox As TextBox)

        Try

            Dim oWord As Object = Nothing

            Dim oDoc As Object = Nothing

            Dim oData As IDataObject = Nothing

            oWord = System.Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"))

 

           Dim  oDocuments as object = oWord.[GetType]().InvokeMember("Documents", _

                           BindingFlags.[Default] Or BindingFlags.GetProperty, _

                           Nothing, oWord, Nothing)

 

 

            oDoc = oDocuments.[GetType]().InvokeMember("Add", BindingFlags.[Default] _

                     Or BindingFlags.InvokeMethod, Nothing, oDocuments, Nothing)

            oWord.Visible = False

 

            oWord.WindowState = 0

            oWord.Top = -3000

            Clipboard.SetDataObject(YourTextbox.Text)

 

            With oDoc

                .Content.Paste()

                .Activate()

                .CheckGrammar()

                .Content.Copy()

                oData = Clipboard.GetDataObject

                If oData.GetDataPresent(DataFormats.Text) Then

                    YourTextbox.Text = CType(oData.GetData(DataFormats.Text), String)

                End If

                .Saved = True

                .Close()

            End With

            oWord.Quit()

            MsgBox("Spelling check complete!")

            'SPELLWORKING = True

        Catch COMEcep As COMException

            MsgBox("MS Word must be installed to perform spelling checks", , _

                   "Spell check is not available")

        Catch ex As Exception

            MsgBox("Error, Make sure you have MS word installed.", , ex.Message)

 

        End Try

End Sub

 

Comments

# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have always found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.

http://www.loresoft.com/Applications/NetSpell/default.aspx
Left by Jeremy on 11/6/2008 6:47 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Hey Now Sherv,

Looks pretty useful.

Thx 4 the info,
Catto
Left by Catto on 11/6/2008 7:04 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Jeremy,
I agree with you I have used NetSpell for the ASP.NET apps, however in this case the cusomer was familiart to word's Spell AND GRAMMER check, and they already had word installed. so this was an alternative. Personally if I have less 3rd party controls I use, the better.
Left by Shervin on 11/6/2008 7:09 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Hi !!! we'll use the overload that takes in the name of a View that it could be transfomed into the latest version that is available in the market.
Regards,
Left by Nutrisystem on 7/23/2009 1:01 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar If you can truley say that the end user will always have word (I bet its like 50% of all pcs everywhere) then why not use this? we all spend far to much money on 3rd party stuff.
Left by pico projectors on 8/4/2009 5:28 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I read the article and it helped and I found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.

thanks for posting on this subject
Left by web development company on 8/13/2009 12:03 PM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar People would get a fresh good knowledge just about Using Words Spellcheck and grammer check with your windows Forms application, if want to buy an essay and buy papers at the writing services!
Left by buy essays on 8/26/2009 3:48 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I read the article and it helped ...ITs Nice
Left by Acne Skin care on 8/26/2009 8:25 AM
# Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Very cool. This is a great tool for us web developers.
Left by Acai Berry on 9/16/2009 6:28 PM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Thanks for sharing these info with us! I was reading something similar on another website that i was researching. I will be sure to look around more. thanks..
Left by quit smoking now on 9/23/2009 12:32 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar This is so helpful, but care to check the flow of your codes here. Yours were overflowing: needs some "cleaning".
Left by hampers on 9/30/2009 9:07 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Thanks for sharing useful information i liked it alot.nice post
Left by Thesis Writing on 9/30/2009 11:00 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have used NetSpell for the ASP.NET apps, however in this case the cusomer was familiart to word's Spell AND GRAMMER check, and they already had word installed. so this was an alternative. Personally if I have less 3rd party controls I use, the better.
regards,
Left by forex trading system on 10/1/2009 3:24 AM
# raja
Gravatar I have always found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.
Left by Luggage Sets on 10/6/2009 2:32 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Very cool. This is a great tool for us web developers.
Gay VOD

Left by Gay VOD on 10/9/2009 5:12 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Very cool. This is a great tool for us web developers

Gay VOD

Left by Gay VOD on 10/9/2009 5:16 AM
# howzzat
Gravatar we'll use the overload that takes in the name of a View that it could be transfomed into the latest version that is available in the market.
Regards,
Left by Best colon cleanse on 10/9/2009 8:07 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Very cool. This is a great tool for us web developers.
Left by Fragrances on 10/12/2009 6:16 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
Regards,
Left by tw steel watches on 10/12/2009 8:28 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have always found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.
Adult Toys

</a
Left by Adult Toys on 10/13/2009 9:55 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar thanks for the details..
Left by medifast coupon on 10/13/2009 10:11 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Never knew that. Thanks for the info. I think your blog is going to
do well. People will always return to read this kind of content.Great job.
Regards,
Left by abstract landscape paintings on 10/16/2009 6:31 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar this is great spelling checking,.
Left by free credit report on 10/19/2009 10:22 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I read the article and it helped and I found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.
Left by Apex Professionals LLC on 10/20/2009 4:00 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I find this post really interesting, thanks!
Left by Math Homework Online on 10/20/2009 7:56 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have used NetSpell for the ASP.NET apps, however in this case the cusomer was familiart to word's Spell AND GRAMMER check, and they already had word installed. so this was an alternative. Personally if I have less 3rd party controls I use, the better.
Left by Apex Professionals LLC on 10/21/2009 3:47 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Left by cheap business cards on 10/22/2009 8:13 PM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have always found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.
Left by T62 on 10/23/2009 1:30 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Thank you for this application.
Left by cheap dental insurance on 10/25/2009 8:10 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar great post.
Left by cheap luggage sets on 10/25/2009 8:12 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar thanks for posting about this topic, great help for me as well..
Left by grocery coupon on 10/26/2009 10:48 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Never knew that. Thanks for the info. I think your blog is going to
do well. People will always return to read this kind of content.Great job.
Regards,
Left by Erie Auto Insurance Quote on 10/27/2009 4:31 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar If you can truley say that the end user will always have word (I bet its like 50% of all pcs everywhere) then why not use this? we all spend far to much money on 3rd party stuff.
Left by Sex DVD on 10/27/2009 9:33 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Looks like a very useful tool....just stumbled onto this site....thanks
Left by power tools reviews on 10/27/2009 6:40 PM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I have used NetSpell for the ASP.NET apps, however in this case the cusomer was familiart to word's Spell AND GRAMMER check, and they already had word installed.
Left by Oxygen sensor on 10/30/2009 2:31 AM
# Mr
Gravatar Please tell me where I put this code. I am newbie and learning code. Need helps..
Left by Dig Bands on 10/30/2009 2:12 PM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar thanks for sharing..
medifast coupon
Left by medifast coupon on 11/3/2009 2:34 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar Thanks for the info. I think your blog is going to
do well. People will always return to read this kind of content.Great job.
Regards,
Left by free online games on 11/5/2009 8:04 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar I read the article and it helped and I found NetSpell to be an excellent free spelling engine that works both in ASP.Net and Windows forms.
Left by Rugs on 11/9/2009 3:56 AM
# re: Using Words Spellcheck and grammer check with your windows Forms application
Gravatar thanks for the information...
Left by amazon coupons on 11/9/2009 4:57 AM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

 

Preview Your Comment.