473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Check spelling

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).
Oct 23 '06 #1
3 6034
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).

Oct 23 '06 #2
Thanks for Your help. However, I'm still looking for .NET solution of this
problem. With regards - Peter
Oct 26 '06 #3
Peter,

Your question isn't really about .Net, it's about the Word object model.
Ergo, you might get more help by posting to a Word newsgroup.

Bill Coan
bi******@wordsite.com
920-779-9148
"Peter" <Pe***@discussions.microsoft.comwrote in message
news:12**********************************@microsof t.com...
Thanks for Your help. However, I'm still looking for .NET solution of this
problem. With regards - Peter

Oct 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tony Roost | last post by:
I have created a test VB.Net form that will use MS Word to check the spelling of text in an input box The test application runs without a problem and I quit the word application at the end of the...
54
by: richard_quick_uk | last post by:
Hi, If anyone's got the time I'd really appreciate any feedback on the accessibility of this site: http://www.cata.co.uk/_index.a­sp
8
by: Steve Jorgensen | last post by:
There's this app I wrote a long time ago for a client who uses it to administer the database content that drives their Web site. Last time I was in there' I notices a lot of embarassing typos in...
2
by: Mike Brearley | last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send a non delivery report back to the sender of the email. Background info: I have a domain hosted on a site that offers...
5
by: FP | last post by:
I'm working with OS X and all apps use the same spell checker, as far as I know anyways. I assumed the PC would have the equivalent and there would be a java script step that launched the spell...
12
by: Ryan | last post by:
Is there anyway to enable spell-checking for user input in a Text Box? Either auto spell-check or create a spell-check button. Using VB 2005.
3
by: John Wright | last post by:
I have a VB program that will be generating documentation that will be stored for 60 years. This program really needs to have spell check and I read the post below on using spell check. I was...
2
by: =?Utf-8?B?cnN1bW1lcmJyZWV6ZQ==?= | last post by:
My spell check does not work, what can I do. -- Have a bless day
0
by: progvar | last post by:
hi i am getting probleum in converting a spell check progrma made in vb 6.0 and Ms-office Word into OpenOffice Word when i made spell check program in Ms-Word and vb 6.0 it works fine but i use...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.