Peter,
If I were you, I would post a general question about this topic to
microsoft.public.word.spelling.grammar or else do a google groups search for
previous posts to that newsgroup.
This is an area that I don't work in very much, and so I don't have an
answer for you, but here's some background information that should help you
begin to think about the problem:
If you paste some "foreign" text into a Word document, Word will honor the
foreignness of it. For example, if you paste in some German text, then Word
will always treat that text as German.
Worse yet, if you paste some UK English into your document,. then Word will
always treat that text as UK English. And, since all variants of English
(UK, US, Australian, etc.) are stored in a single dictionary, words like
Colour won't be marked as misspelled if they are marked as UK English.
Here's some more background:
The problem is that as soon as you paste some
text from another source that has English (UK), MS sees it and checks
whether there's a proofing tool available. Because the English proofing
tools cover all the ENG variants in one package, the tool for UK English is
available and therefore MS thinks it's being nice when it re-enables English
(UK) for you. Afterall, you were suddenly writing in it again (because it
came in via the paste).
Once text has been entered and identified with a language, that language
setting always wins. This is the edit language and set via the Proofing
Tools Language Settings. Text always has an edit language -- if you're
getting the wrong variant of a language (for instance, German German rather
than Swiss German) it means either that the text has that as the edit
language (that is, what you see as Swiss German is tagged as German German)
or the required proofing tool isn't available for that language (so Swiss
German is unavailable and MS used the closest available option -- German
German).
That's for text that's in the document. But what about when you are first
entering text? Well, MS could assume that there's always an edit language
and let that win but that would mean that bilingual users would have to
switch a setting in each of their applications every time they changed
langauges. As was pointed out earlier, Windows is where you switch between
keyboards. If you tell an application that your input has changed from
English to Japanese, you expect your application to follow along and mark
the text that you insert as Japanese. So that's why Windows overrides
Office. This is the input language.
The rule for Word is that when you change input languages, that overrides
edit language but when you place new text within existing text the edit
language overrides the input language.
When you paste from another source, you are including the edit language,
which MS doesn't change. Pasting has no associated input language.
Word has some particular logic for adjusting the editing or input language:
* Keyboard AutoDetect -- when you have multiple keyboards installed and this
option is active and you click into text of one of the languages, MS
switches
the keyboard to match (that is, it makes the input language match the edit
language).
* Language AutoDetect (LAD) -- when multiple languages are enabled and you
start typing in any of those enabled languages, Word checks to see which of
the languages you are most likely using. MS waits until you have written
about a sentence and then changes the edit language of the text you are
entering--even if it no longer will match the input language.
Another limitation is that LAD only works among languages that are enabled.
Thus, if you reply to a message with the Normal
language set to something you don't use, LAD will never activate. So the
"Normal" style is set to German, the original person writes in English (LAD
is active because both German and English are enabled so the edit language
is set correctly), when the recipient (who has only English enabled)
replies, their text is set to German (and LAD doesn't work because German
isn't enabled on their system).
--
Bill Coan
bi******@wordsite.com
920-779-9148
"Peter" <Pe***@discussions.microsoft.comwrote in message
news:2B**********************************@microsof t.com...
Hello!
I'm trying to implement a method, that checks spelling of a text and
suggests corrections. The C# program looks like:
...
Word.Application spellApp = new Word.Application();
Word._Document spellDoc = spellApp.Documents.Add(...);
Word.SpellingSuggestion ss;
...
if (!spellApp.CheckSpelling(singleWord,
ref misVal, ref misVal, ref misVal, ref misVal,
ref misVal, ref misVal, ref misVal, ref misVal,
ref misVal, ref misVal, ref misVal, ref misVal))
ss = spellApp.GetSpellingSuggestions(singleWord, ref misVal,
ref misVal, ref misVal, ref misVal, ref misVal,
ref misVal, ref misVal, ref misVal, ref misVal,
ref misVal, ref misVal, ref misVal, ref misVal)
The question is: how to force the use of a specific spelling dictionary? I
need to be sure, that the spelling is checked for German language,
regardless
of Word settings (i.e. English).