User Dictionary

Three weeks into the rollout of the WPF veterinary records system, Dr. Ortega's clinic logs the same complaint nine times: every drug name, every breed shorthand, every clinic-internal abbreviation gets a red squiggle. The vets are crossing them out with their eyes. Carprofen, doxy, FeLV, OHE -- none of these are in a general-purpose dictionary, and a vet who has to right-click carprofen twelve times in a morning is a vet who will quietly turn off spell-checking on the toolbar and never turn it back on.

Anita, the developer who shipped the system, does not want to bake a veterinary glossary into the build. Every practice has different shorthand. What she wants is for each vet to teach the dictionary their own vocabulary, once, and never see those squiggles again. That feature already exists in the editor -- it just needs to be turned on and pointed at a writable file.

What the user sees

When inline spell checking flags a word, the user right-clicks it. The suggestion context menu drops down, and underneath the suggested corrections is an entry labelled Add to Dictionary. Selecting it makes the squiggle disappear immediately, persists the word to a file, and means the same squiggle will not return tomorrow, next week, or on the next session of the laptop.

WPF HTML editor right-click suggestion menu showing the Add to Dictionary option for a flagged veterinary drug name

Turning the feature on

Two settings on SpellCheckOptions do the work. The first toggles the menu entry on. The second tells the editor where to keep the file. Anita uses each vet's Windows user profile so the dictionary follows them across the clinic's shared workstations:

RecordEditor.SpellCheckOptions.EnableUserDictionary = true;

var perUserFile = System.IO.Path.Combine(
    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
    "VetRecords",
    "spellcheck-user-dictionary.txt");

RecordEditor.SpellCheckOptions.DictionaryFile.UserDictionaryFilePath = perUserFile;

The file is plain text, one word per line. It is created on first save if it does not exist. Backing it up is a matter of copying the file. Pre-seeding new hires with the clinic's existing shorthand is a matter of dropping a starter file into the AppData folder during onboarding.

The plain-text user dictionary file opened in Notepad showing one custom veterinary term per line

Speaking the user's language

The phrase Add to Dictionary is fine for English-speaking vets. For the Spanish-speaking branch of the practice, Anita overrides the label so the menu reads more naturally:

RecordEditor.SpellCheckOptions.AddToDictionaryText = "Agregar al diccionario";

The same property is the hook for any rebrand -- a corporate customer who wants the menu to read Add to Company Glossary changes one string and ships.

When the engine is not the built-in one

If the clinic ever moves to a centralised terminology service (the path the clinical-trials team in Using a Custom Spell-Check Engine took), the file-path setting becomes irrelevant. The Add to Dictionary menu still appears, but the editor now calls AddToUserDictionary(string word) on the custom engine. Whether that word is persisted to a local file, sent to a corporate API, or simply held in memory for the session is the engine implementer's decision. The end-user experience -- right-click, click, squiggle gone -- is identical.

The result for Dr. Ortega's clinic

Two weeks after Anita shipped the change, the support inbox for spell-check complaints went quiet. Each vet had spent a few sessions teaching the editor their personal shorthand, the file followed them between workstations, and the feature stayed on. That is the only metric that mattered.

Last updated on May 12, 2026