Modifying Spell Check for SharePoint Server 2007, Page 4
With the preceding code, all the texts found on the page will be scanned. If you want to exclude any of the text from correction, use the attribute "excludeFromSpellCheck" in the HTML syntax. For example, to create a text box controlled by the server where no spell check is desired, use:
<asp:TextBox ID="TextBoxNoControled" runat="server" excludeFromSpellCheck="true" />
Note: The "excludeFromSpellCheck" attribute can be used in a similar way in client-side controls by using HTML code.
If necessary, it also is possible to modify the files SpellChecker.aspx, SpellChecker.js and/or SpellCheckerEntirePage.js, but it is not recommended or effective because any future Microsoft Service Pack can revert the files to the original state.
MOSS has default correction dictionaries for each supported language, but it is impossible to modify them. However, it is possible to add words in such a way that they are not identified as errors. The following process creates a type of custom dictionary for these words:
- Create a new Document Library, "Spelling," at the root of the Portal.
- Create a text file, "Custom Dictionary.txt," locally.
- Add all the words that should not be recognized as spelling errors in the text file, one word per line.
- Upload the text file to the newly created Library above.
Only one "Custom Dictionary" Document Library is possible for each site collection; the names of the Library and text file need to be exactly as indicated and the Library must be located at the root of the Portal.
A valuable feature of SharePoint 2007 is the introduction of an online spell check program. The system is presented as a WebService, but the feature has some errors that need workarounds to function properly.
Spell Check is a default component of Microsoft Office SharePoint Server (MOSS) but is not available in Windows SharePoint Services (WSS). The system is a welcome adaption and covers the supported SharePoint Languages. It is effective for detecting orthography errors and provides correction suggestions; however, the downside is that it lacks a grammar and a thesaurus and the dictionaries cannot be modified.
The default window of the corrector can be used in custom components inside SharePoint, as ASPX pages, with the inclusion of a few lines of code. Finally, although the dictionaries cannot be modified, it is possible resolve this inadequacy by creating a list of words to be excluded from Spell Check control.
About the Author
Gustavo Velez is a MCSD Senior Application Developer for Winvision (http://www.winvision.nl), a Microsoft Gold Partner in the Netherlands. He has many years experience developing Windows and Office applications, and more than six years of daily programming experience with SharePoint. The author's articles can be found in many of the leading trade magazines in English, Dutch, and Spanish. He is also pleased to be Webmaster of http://www.gavd.net/servers, the only Spanish-language site dedicated to SharePoint. Spanish-language readers may want to consult Velez's book; Programacisn con SharePoint 2007 (http://www.dotnetmania.com/Libros/index.html). Velez has been awarded MVP status (Most Valuable Professional, http://mvp.support.microsoft.com/), in the area of SharePoint MOSS.