GetSpellingSuggestions problem

  • Thread starter Andrew Fiddian-Green
  • Start date
A

Andrew Fiddian-Green

Can anyone please suggest to me why the second call to
GetSpellingSuggestions() below raises an exception when the first one works
fine?

VarCustDict := 'C:\myPath\myDictionary.dic';

VarLang := wdEnglish;
VarDict := fWordApp.Languages.Item(varLang).NameLocal;

lSuggestions :=
fWordDoc.Range.GetSpellingSuggestions(VarCustDict,
EmptyParam,
VarDict,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam);


VarLang := wdFrench; // for example...
VarDict := fWordApp.Languages.Item(varLang).NameLocal;

lSuggestions :=
fWordDoc.Range.GetSpellingSuggestions(VarCustDict,
EmptyParam,
VarDict,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam,
EmptyParam);

Regards,
AndrewFG
 
W

Word Heretic

G'day "Andrew Fiddian-Green" <ho ho ho>,

The base language for the specified dictionary is incorrect?

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice
 
A

Andrew Fiddian-Green

The base language for the specified dictionary is incorrect?

Nope. I checked that.

1) VarCustDict: the custom dictionay is set for "All Languages". (As in Word
| Tools | Options | Spelling & Grammar | Custom Dictionaries | Modify |
Language )
2) VarDict: both the standard dictionaries English and French are installed

The exception message is (something like) "The custom dictionary
C:\myPath\myDictionary.dic is not available" so the problem seems to be with
VarCustDict rather than VarDict.

Could it be that the first GetSpellingSuggestions call is placing a lock on
the custom dictionary file which has to be released before I can make the
second GetSpellingSuggestions call?

Regards,
AndrewFG
 
W

Word Heretic

G'day "Andrew Fiddian-Green" <nn@dd>,

"The custom dictionary C:\myPath\myDictionary.dic is not available"

This would seem to me to indicate more that the dictionary is not
available in that language as we know the path/filename is correct. I
haven't played around with dictionaries in multiple languages much, so
I am sorry I cannot offer better help.

After you set the language to French, what does your
CustomDictionaries collection contain?

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Andrew Fiddian-Green reckoned:
 
A

Andrew Fiddian-Green

After you set the language to French, what does your
CustomDictionaries collection contain?

I think I found the problem: my custom.dic is (was) Unicode encoded i.e.
with a "bom"

I heard somewhere that Word 2003's English spelling machine supports both
Unicode and ANSI encoded dictionaries; by absence of other information, this
seems to imply that the French spelling machine does not supports Unicode
encoded dictionaries.

But, I also read something that implies that Word 2004 supports Unicode and
ANSI encoded dictionaries -- for ALL languages.

Can anyone confirm this?

Regards,
AndrewFG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top