Spell checker for HTML, ASP.NET, JScript, VB, C#, CSS and C++

Following Visual Studio 2008 release I updated my Spell Shecker add-in so it works with VS 2008 as well as added some new functionality. So here is version 2.0, updated for VS 2005 and now available for VS 2008.

Usual disclaimer

This software is provided "AS IS" without any warranty, implied or otherwise. I wrote this software in my own spare time, it is not supported by Microsoft Corporation in any way. The software is provided in binary form, free of charge. If you wish to send me a bug report, suggestion or ask a question, please use my blog. You can post question or suggestion in the comments.

What's new in version 2.0:

Spell checker now supports text verification in:

  • HTML style comments <-- HTML -->
  • ASP.NET server side comments: <%-- ASP.NET --%>
  • JScript, C# and C++ comments: // C++ style comments
  • CSS and C style comments: /* C style comments */
  • VB and VBScript style comments: 'This is VB comment

Spell checking is supported in style and script blocks as well as in JS, CS, VB, CSS, CPP ahd H files. There are two separate binaries for VS 2005 and VS 2008. The can be installed side by side if you have both VS 2005 and VS 2008 installed on the machine.

Requirements:

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

Installation

Close Visual Studio
Download and run VSSpellChecker2005.msi or VSSpellChecker2008.msi.
Run Visual Studio
Open a Web site or standalone HTML, ASP, VB, C#, JS, VBS, CSS or CPP file.
You should see Spell Checker entry in the Tools menu.

Uninstall

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

How to use the Spell Checker

Open a Web Form, HTML, ASP, JS, VBS, CS, VB, CPP or CSS file and click Tools | Spell Checker. Spell check may take 10-15 seconds on decently sized files. There is no immediate progress indication, but you can see that squiggles appear one by one under misspelled words. Double click on the misspelled word brings list of suggestions. <Cancel> 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.

VS 2005 screenshot:

Spell Checker for VS 2005

VS 2008 screenshot:

Spell Checker for VS 2008

As before, Spell Checker support mutiple languages in HTML markup, it detects lang attribute specified on elements, extracts ISO language and uses it to specify appropriate dictionary for the Office spell checking engine.It uses default Office spell checking language in code comments:

Multilanguage spell check

In order to be able to spell check multiple languages you may need to install Microsoft Office 2003 Proofing Tools or an appropriate Office 2007 Language Pack. If you never used particular language dictionary in Word, you have to try it before it becomes available in the Spell Checker add-in. Many dictionaries are installed on demand and if particular language was never activated in Word, the dictionary may be still missing. Open Word, type something in the desired language and run Word spell checker at least once to make sure it works and dictionary is installed.

Customization

You can customize spell checker behavior by editing rules.xml file located in Program Files\VS 2005 Spell Checker Add-In or VS 2008 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>

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

Visual Studio 2005 Add-in download

Visual Studio 2008 Add-in download

Troubleshooting

You may have to run as admin during the setup since add-in needs to register COM components. If, for some reason, add-in does not appear in Visual Studio, try running regsvr32 vsspellchecker.dll from command line in the add in installation folder in Program Files.

Enjoy :-)

Comments

  • Anonymous
    December 12, 2007
    Hi Mikhail, Thanks for providing this tool. I installed the VS2005 version, but it doesn't show up under Tool menu. I cannot see it in the Add-in manager either. My settings: VS2005 Standard Edition, ReSharper 3.0.2, and TestDriven 2.0 installed. VS2008Beta2 installed. Word 2003 installed as well. Thanks, Kevin

  • Anonymous
    December 12, 2007
    Hi Mikhail, Thanks for providing this tool. I installed the VS2005 version, but it doesn't show up under Tool menu. I cannot see it in the Add-in manager either. My settings: VS2005 Standard Edition, ReSharper 3.0.2, and TestDriven 2.0 installed. VS2008Beta2 installed. Word 2003 installed as well. Thanks, Kevin

  • Anonymous
    December 13, 2007
    You sir are awesome.  This save me the headache of copying and pasting my text into word for spell checking.  Keep up the good work.

  • Anonymous
    December 13, 2007
    You may have to run as admin if you are on Vista. Try running regsvr32 vsspellchecker.dll manually.

  • Anonymous
    December 17, 2007
    Hi I have the same problem as Kevin. Running regsvr32 didn't help either. I am using XP with admin rights. What to do next?

  • Anonymous
    December 18, 2007
    Hi Mikhail, Thanks for providing this tool, it is very useful especially if the comments in the source are used for generating the documentation. Is there a way to manually select which language dictionary the checker should use for the current file? We are commenting on different languages in different projects so using the default Office spell checking language is sometimes great but other times another language would be desired. If I am correct the only way to select a language is to start Office and change the default spell checking language? Thanks again.

  • Anonymous
    December 18, 2007
    György, please have a look here: http://blogs.msdn.com/mikhailarkhipov/archive/2007/12/18/how-to-select-language-for-spell-checking-in-code-comments.aspx

  • Anonymous
    December 19, 2007
    I am seeing the any word next to </param> flagged.  Is there a way I can use the rules to ignore the xml? Message 15 Spelling error: configure</param> Module.cs

  • Anonymous
    December 19, 2007
    Great tool, but a couple of comments:

  1. Is it possible to make it run against all files in a folder/project/solution??
  2. It doesn't like databinding and assumes a spelling mistake. E.g. <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' />. It thinks Eval("Description") is a spelling mistake! Thanks, James
  • Anonymous
    December 19, 2007
    James: have a look here: http://blogs.msdn.com/mikhailarkhipov/archive/2006/05/29/running-html-spell-checker-on-all-asp-net-and-html-files-in-the-solution.aspx Currently spell checker does not tell if attribute value is text or code. I probably need to beef up the parser :-) Chris: it is a a bug, thanks for reporting it, I'll try to take care of it as soon as I can.

  • Anonymous
    January 03, 2008
    I've installed the Add-In for Visual Studio 2008. As I opened the studio there was no item within the Tools menu called SpellChecker. After I  registered the *.dll manually the menu item was available. I opened a few html files and used the Spell Checker which worked very well. But unfortunately after a few files the Spell Checker does not work anymore. After choosing the menu item VS is busy for a few seconds but after that nothing happens. I've already tried to reinstall the Add-In but that didn't work either. Furthermore I've installed the 2005 Add-In which indeed shows the same symptoms. Has anyone experienced similar problems? Is there any solution for that. I've evaluated various Spell Checkers for VS and this one seems to be the best. Therefore I would be glad if anyone could help me. Thanks, Stefan