public Form1() { InitializeComponent(); richEditControl1.CreateNewDocument(); SetAutoCorrectOptions(); richEditControl1.Document.AppendText(@"This sample expander uses Mary Morken's 2007 list of abbreviations for medical transcriptions, containing 13420 entries. The list has been downloaded from http://www.mtdaily.com/abbvs.txt. To indicate the beginning of the list, the line containing the 'START' string is added."); #region #autocorrectservice IAutoCorrectService svc = richEditControl1.GetService <IAutoCorrectService>(); if (svc != null) { svc.SetReplaceTable(LoadAbbrevs("abbvs.txt")); } #endregion #autocorrectservice }
void richEdit_Loaded(object sender, System.Windows.RoutedEventArgs e) { richEdit.SpellChecker = spellChecker; richEdit.Options.AutoCorrect.CorrectTwoInitialCapitals = true; richEdit.Options.AutoCorrect.UseSpellCheckerSuggestions = true; IAutoCorrectService service = richEdit.GetService <IAutoCorrectService>(); if (service != null) { AutoCorrectReplaceInfoCollection replaceTable = new AutoCorrectReplaceInfoCollection(); replaceTable.Add("(C)", "©"); replaceTable.Add(new AutoCorrectReplaceInfo(":)", OfficeImage.CreateImage(GetType().Assembly.GetManifestResourceStream("RichEditDemo.smile.png")))); replaceTable.Add("pctus", "Please do not hesitate to contact us again in case of any further questions."); replaceTable.Add("wnwd", "well-nourished, well-developed"); service.SetReplaceTable(replaceTable); } }