Spell Checker for HTML and ASP.NET pages


This article is obsolete. Please look here for newer version http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx 


Updated version is available here: http://blogs.msdn.com/mikhailarkhipov/archive/2007/12/12/spell-checker-for-html-asp-net-jscript-vb-c-css-and-c.aspx 


I finally finished writing HTML spell checker add-on to Visual Studio. Spell checker works in Source view, it is able to extract text from markup elements and use Office 2003 spell checker to check the text. Spell checker is able to handle entities to some extent (they are considered whitespace for now). It is also able to spell check values of attributes that typically contain human readable text. You can customize spell checker behavior by editing an XML file. Since the add-on uses Office spelling engine, you must have Office 2003 or at least Word 2003 installed. Spell checker uses active Office dictionary. Therefore if page is in Japanese, but primary dictionary set in Office is in English, spell checking will be done in English. Current version does not merge words split by tags, such as <b>S</b>ymbol. I am planning to add this functionality in a future version. Right click on the misspelled word does not bring suggestions, double-click does. This is because right-click in VS 2005 HTML editor is hardcoded for the context menu and cannot be overridden.

Important note: add-on does not work with Visual Web Developer Express as Express editions are not extensible.
 

Disclaimer:


The software is provided “AS IS” with no warranties of any kind. The entire risk arising out of the use or performance of the software is with you. I wrote this software in my own spare time, it is not supported by Microsoft Corporation. The software is provided in a binary form, free of charge. If you wish to report bugs or suggest improvements, you can either post bug report here in comments or send bug report to me using email link at the top of this page.

Requirements:


Microsoft Visual Studio 2005, any edition except Express.
Microsoft Word 2003

Installation


Close Visual Studio
Download and run Setup.msi
Run Visual Studio
Open a Web site or standalone HTML file.
You should see HTML Spell Checker entry in the Tools menu.

Uninstall

Close Visual Studio
Open Control Panel
Go to Add/Remove Programs
Locate HTML Spell Checker Add-in to Visual Studio 2005 and click Remove

How to use the Spell Checker

Open a Web Form, HTML or ASP file and click Tools | HTML Spell Checker. Spell check may take 10-15 seconds on decently sized file. There is no immediate progress indication, but you may see that squiggles under misspelled words appear one by one. You should get squiggles under misspelled words. Double click on misspelled word brings list of suggestions. closes the suggestion list. Spell checker messages also show up in the Error List as informational messages. They are not entered as errors or warnings so they don’t break builds.

Limitations:

1. Spell checker only works in Source view.
2. Spell checker is using active Office dictionary. Therefore if page is in Japanese, but primary dictionary set in Office is in English, spell checking will be done in English.
3. Current version does not merge words split by tags, such as <b>S</b>ymbol. I am planning to add this functionality in a future version.
4. Right click on the misspelled word does not bring suggestions, double-click does. This is because right-click in VS 2005 HTML editor is hardcoded for the context menu and cannot be overridden.
5. No progress indication.

Customization

You can customize spell checker behavior by editing rules.xml file located in Program Files\HTML Spell Checker Add-In. You can exclude certain elements and add more rules for attribute checking. You probably want to do that if you are using custom controls and want spell checker to verify spelling in custom control attribute values. All element and attribute names much be in lowercase. You don’t have to close the HTML document or Visual Studio after editing the file, the file is loaded every time spell checking is performed.

<?xml version=”1.0″ encoding=”utf-8″?>
<rules>
  <!– Exclude content of script and style elements from spell check –>
  <exclude name=”script” />
  <exclude name=”style” />

  <!– Check ‘value’ attribute on all elements without a namespace –>
  <element name=”*”>
    <attribute name=”value” />
  </element>

  <!– Rules in ASP namespace –>
  <namespace name=”asp”>

    <!– Check all attributes ending in ‘text’ as well as tooltip attribute in all ASP.NET elements –>
    <element name=”*”>
      <attribute name=”*text” />
      <attribute name=”tooltip” />
    </element>

    <!– Special rule for asp:Calendar –>
    <element name=”calendar”>
      <attribute name=”caption” />
    </element>

    <!– Add more rules for ASP.NET elements here if needed –>
  </namespace>

  <!– Add rules for custom controls here if needed –>
 
</rules>


Spell checking XML files:


See here http://blogs.msdn.com/mikhailarkhipov/archive/2006/04/20/579980.aspx



Troubleshooting:


Look here: http://blogs.msdn.com/mikhailarkhipov/archive/2006/04/18/578529.aspx


Running HTML Spell checker on all ASP.NET and HTML files in the solution:


Look here: http://blogs.msdn.com/mikhailarkhipov/archive/2006/05/29/610380.aspx


New version with multilanguage support: http://blogs.msdn.com/mikhailarkhipov/archive/2007/04/29/spell-checker-for-html-and-asp-net-multilanguage-edition.aspx


Download location.

Enjoy! 🙂


Comments (52)

  1. Roger's Blog says:

    Mikhail Arkhipov just released a spell checker that validates spelling in HTML and ASP.NET pages within…

  2. Sean says:

    Thanks for a nice addin

  3. This is the type of plug-in that I wish I had last week :)&amp;nbsp; Mikhail has built an amazing plug-in…

  4. Bardzo ciekawy plugin sprawdzający pisownię stron ASP.NET.

  5. IDisposable says:

    This really rocks (on my machine), but a coworker can’t get it running. Any ideas on logging or what-not to see why?  The add-in doesn’t appear on the Tools/Add-in Manager… dialog and we don’t get an option in the Tools menu.  His installation worked fine, files are all in "C:Program FilesHTML Spell Checker Add-In" directory.  He’s got Office 2003 installed (like me), and the PIAs are installed (like me).

  6. The component should show up in the registry under HKEY_CURRENT_USERSoftwareMicrosoftVisual Studio8.0Addins. There should be a few settings there and class name HTMLSpellChecker.Connect.1 which, it turn, should appear under HKEY_CLASSES_ROOTHTMLSpellChecker.Connect.1 and HTMLSpellChecker.Connect. The latter contains a GUID that should be under HKEY_CLASSES_ROOTCLSID and contain reference to the component.

    You may try running regsvr32 vsspellchecker.dll from command line.

  7. If you want to learn how to use Office components (such as spell checker)&amp;nbsp;in VS add-ins, look at…

  8. s says:

    cant get it to work, but class-diagramms also not work on my machine..

  9. Well, if you are like me, you do!&amp;nbsp; When building web applications and switching between code and…

  10. Ogre says:

    Yeah I can’t get it to show up in Tools either. I’ve got the XNA stuff installed and I had beta 3 refresh of the TFC client installed but its been gone for a while. I’ve also got DevExpress and GhostDoc installed, could they be somehow screwing with the intallation?

  11. Et oui, vous ne revez pas. Mikhail Arkhipov (MSFT)&#160; vient se sortir un plug-in pour visual Studio 2005…

  12. Varad says:

    Cool…

  13. UnquaLe says:

    Mikhail

    from the Visual Studio Web Tools Team just published a cool free

    plug-in for VS 2005 (that…

  14. Ogre says:

    This trick fixed my installation:

    regsvr32 vsspellchecker.dll

    Thanks!

  15. Arnie Zokas says:

    Wow! Thanks for such a great plugin!!!

  16. I just found this little gem via ScottGu; it a spell checker writen by
    Mikhail
    Arkhipov &amp;nbsp;for use…

  17. karl says:

    Any chance you could add support for other files types such as xslt and xml?

  18. Trackback from dotnetkicks.com

  19. A few people asked if HTML Spell Checker can check XML and XSLT files. Not directly, as XML files are…

  20. ELan1234 says:

    Thanks, It’s really a cool one…

  21. Dan Bartels says:

    One of my fellow Telligenti (Rich Mercer) alerted me to a new addon for Visual Studio 2005, by Mikahil…

  22. Mikhail from the Visual Studio Web Tools Team just published a cool free plug-in for VS 2005 (that…

  23. Will Ballard says:

    Actually, it’s possible to have a right click menu in the editor in Visual Studio.

    http://www.mailframe.net/Products/CodeSpell/ — doesn’t require Office

  24. All editors in VS are different. The underlying core text editor is the same, but each language or designer provides its own colorization, intellisense and context menus. Some provide ways to extend context menu and some don’t. Sure, you can always override right click by subclassing a window and provide a new one that looks like the original one plus some new items, but I decided that maybe I’ll do it next time.

  25. Looking for a way of checking your HTML and ASP.NET&amp;nbsp;markup for spelling errors in Visual Studio…

  26. Mikhail Arkhipov on our team recently developed a spell checker add-in to Visual Studio 2005 that allows…

  27. Nikhil says:

    Fantastic , I like it.

  28. Can I use Visual Web Developer Express for the project I am planning? Do I need to buy Visual Studio…

  29. Overview I recently ditched my AMD desktop machine and picked up an ASUS G1 notebook. I like ASUS…

  30. I finally got around to implementing support for multiple languages in my HTML / ASP.NET spell checker

  31. Al Pascual says:

    Any chance for you to share the source code?