Spellchecking with word


2008-06-22 05:05:59 PM
delphi233
Hi,
I am trying to spell check using MSWords spellchecker through Delphi 2007.
I am using:
msWordApp, msSuggestions, aDict : OleVariant;
strWord : String;
msWordApp := CreateOleObject('Word.Application');
//This works fine
aDict := msWordApp.languages.Item(Flanguage).ActiveSpellingDictionary;
//This works fine
msWordApp.CheckSpelling(StrWord, EmptyParam, EmptyParam, aDict,
EmptyParams....) //My "aDict" variable is ignored
msSuggestions := msWordApp.GetSpellingSuggestions(strWord, EmptyParam,
EmptyParam, aDict, EmptyParams....) //My "aDict" variable is ignored
So both methods CheckSpelling and GetSpellingSuggestions completely ignore
the dictionary varaible "aDict" I pass. I have verified that I indeed do get
the correct dictionary using the activeSpellingDictionary method. Word spell
checks using the default dictionary that is set up.
I have searched and found that many people have the same problem, and that
some can use the workaround by passing a valid custom dictionary in stead of
the first EmptyParam
msSuggestions := msWordApp.GetSpellingSuggestions(strWord, 'CUSTOM.DIC',
EmptyParam, aDict, EmptyParams....)
However, it seems I dont have a 'CUSTOM.DIC', or any other valid custom
dictionary... Or I dont understand how its supposed to work.
Could anyone explain to me how I get the custom dictionary workaround to
work, or to get the GetSpellingSuggestions to work in any other way?
Thank you very much in advance
oh, if its not too much trouble, please reply both to the newsgroup and to
my mail address.. thanks
Regards Jens Fudge