Spell Checking, MailMerge and UserDictionaries
Today, we received an interesting request from a TX Text Control user. The requirement was straightforward: A template should be prepared by merging data using the MailMerge component. The resulting document has to be presented to the end-user to allow final changes or to add additional text. But the merged text, that comes directly from the data source, shouldn't be marked as incorrect by TX Spell .NET, even if the field text is misspelled. This requirement can be easily solved using a…


Today, we received an interesting request from a TX Text Control user. The requirement was straightforward:
A template should be prepared by merging data using the MailMerge component. The resulting document has to be presented to the end-user to allow final changes or to add additional text.
But the merged text, that comes directly from the data source, shouldn't be marked as incorrect by TX Spell .NET, even if the field text is misspelled. This requirement can be easily solved using a UserDictionary. TX Spell .NET can be used with an umlimited number of UserDictionaries thus allows you to use them for other purposes as well.
In this case, we would like to store all words from the mail merge process in a separate UserDictionary. This can be achieved in the FieldMerged event of the MailMerge class:
TXTextControl.Proofing.UserDictionary user =
new TXTextControl.Proofing.UserDictionary();
private void mailMerge1_FieldMerged(object sender,
TXTextControl.DocumentServer.MailMerge.FieldMergedEventArgs e)
{
MergeField field = e.MailMergeFieldAdapter as MergeField;
foreach (string word in field.Text.Split(\' \'))
{
user.AddWord(word);
}
}
These words are now ignored automatically and you can remove the temporary UserDictionary when merging the next document.
Related Posts
Interactive Spelling Suggestions Using TX Spell .NET
With the introduction of touch-enabled interfaces in many applications, new requirements are coming up. Users expect tailored interfaces for various scenarios. In a touch-enabled word processor…
TX Spell .NET: Creating Custom Context Menus
Using context menus in TX Spell .NET is very simple: When connected to TX Text Control, the built-in context menu works out-of-the-box without implementing a single line of code. TX Text Control…
Porting RapidSpell to TX Spell .NET
Our new spell checking component TX Spell .NET can be easily used to replace RapidSpell in your projects. Integrating TX Spell .NET into TX Text Control based applications is as easy as 1-2-3.…
Using the WSpell ActiveX Spelling Checker with TX Text Control
A brief article, with sample source code, that shows you how to add spell checking capabilities to your TX Text Control application, using the popular ActiveX spell checker, WSpell, from Wintertree.
Create a Table of Contents in Windows Forms using C#
This article explains how to create a table of contents in Windows Forms using the ribbon or programmatically. Creating a table of contents is required to organize large documents.