all groups > dotnet windows forms designtime > january 2006 >
You're in the

dotnet windows forms designtime

group:

Problem in using word object


Problem in using word object Gomathi
1/3/2006 3:22:27 PM
dotnet windows forms designtime:
hi all,

In my windows application, i added a word object reference.
Using word object, i'm doing spell checking. After spell checking, i quited
the word object. But still its running in task manager and utilizing 100% in
CPU. How to solve this?. I attached the code which i used in my application.

string strVal = "Good";
Word.Application oWord = new Word.Application();
object missingType = Type.Missing;

bool blnSpell = oWord.CheckSpelling(strVal,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType,
ref missingType, ref missingType, ref missingType);
if(blnSpell)
label3.Text = "Correct";
else
label3.Text = "InCorrect";

oWord.Quit(ref missingType,ref missingType,ref missingType);

My ambition is to use spell check in my application. Is there is any other
way to do this?

Thanks in advance.
Regards,
Gomathi

Re: Problem in using word object Drew Wildner
1/10/2006 4:12:02 PM
Make sure to release all unmanged resources in a finally block and handle
all errors. You will see it disappear from the list of running processes.
If it does not, I'd verfiy that you do not have an unhandled exception.

D


try{

//All your previous spellchecking

}finally {


Word_App.Quit(ref falseRef, ref missing, ref missing);

System.Runtime.InteropServices.Marshal.ReleaseComObject(Word_App);



}

D


[quoted text, click to view]

AddThis Social Bookmark Button