Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

specify custom dictionary in spell check

Status
Not open for further replies.

mirirom

Programmer
Jul 21, 2001
110
US
hi,

i'm wondering if anyone can shed some light on this. i'm have an application that utilizes the spelling engine within Office and i'd like to be able to "check spelling" only against a specified dictionary file.

here's some example code for spell checking with the default dictionary:
Code:
Word.ApplicationClass appWord = new Word.ApplicationClass();
object filler = System.Reflection.Missing.Value;
object appOpts = Word.WdSaveOptions.wdDoNotSaveChanges;

string strSomeString = "misxspelled wordz";
bool blnWordFound;

appWord.Documents.Add();

//returns false if string argument(s) are misspelled
blnWordFound = appWord.CheckSpelling(strSomeString,
   ref filler, ref filler, ref filler, ref filler,
   ref filler, ref filler, ref filler, ref filler,
   ref filler, ref filler, ref filler, ref filler);

the
Code:
ApplicationClass.CheckSpelling()
method does in fact allow you to specify additional custom dictionaries, however, i'm unsure about how to pass these reference items in. is it just an object with an assigned value such as
Code:
object custDict = "someDictionary.dic"
?

additionally, is it possible to specify that the default dictionary NOT be used. ideally i'd like to be able to have this method use a dictionary file that is not associated with MSOffice. i plan to include this .dic file with the distributed app. any assistance is greatly appreciated. thanks in advance...

..:mirirom:..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top