Working on a project I needed to be able to offer the user the ability to spell check the content they entered into a text editor. Not wanting to use a third party text editor I found that I could use the Microsoft Office utility.

First start off by creating a text editor, below I am using the AJAX toolkit HtmlEditorExtender which is available in the latest toolkit version.

Next is the code to call the Word spell check dialog.

First you need to create a reference to the Microsoft Word 12.0 Object Library COM object.
(In the example I am using VB.net but C# is the same.)

When clicking the spell check button, the code will call the Microsoft Word’s SpellCheck/Grammar dialog box for display. After all the spelling/grammar errors are corrected, the dialog writes the changes back into the textbox.

This functionality is nice and easy to implement but there are some exceptions that need to be pointed out before making a decision that this solution is right for you.

First, you will need a license copy of MS Word installed on the server that the application is hosted on. Second I have found a KB article written by Microsoft (Considerations for server-side Automation of Office) where Microsoft points out that even though the implementation is easy, there are a number of complications that can occur and that they do not recommend or support server-side Automation of Office.

Like this post? Share it!