WINWORD.EXE still showing in task manager after using word to spell check text boxes.

G

Guest

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 spell check. However, the application is leaving a trail of winword.exe processes running on the system

PC is running W2000 SP

The code and details of the form are detailed below. If anybody has any ideas about a word around or another way to add spell checking capabilities to my applications I would be grateful

Thanks Ton

The form only contains one button and a text box. I have added a reference to the com object 'Microsoft Word 9.0 Object Library' and imported it at the top of the forms VB Page

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic

checkSpell(Me.TextBox1.Text

End Su

Private Sub checkSpell(ByVal strText
Dim oWord As New Word.Application(
Dim oDoc As Word._Documen


' Check the spelling.
' If the spelling is incorrect then do the full word document thing..

If Not oWord.CheckSpelling(strText) The
oWord = CreateObject("Word.Application"

oWord.Visible = Tru
oDoc = oWord.Documents.Ad

oDoc.Range.Text = Me.TextBox1.Tex

' Setup the option


With oWord.Application.Option
.CheckGrammarWithSpelling = Tru
.SuggestSpellingCorrections = Tru
End Wit

' Check the spellin

oDoc.CheckSpelling(

' Return the value back to the text bo

Me.TextBox1.Text = oDoc.Range.Tex

' Set the saved flag so that we don't get prompted to save the documen
' that we are about to close.

oDoc.Saved = Tru

' Close the documen

oDoc.Close(False

End I

' Tidy up the allocations..

Tr


' Quit the word applicatio

CType(oWord, Word._Application).Quit(
oDoc = Nothin
oWord = Nothin
Catch excp As Exceptio

End Tr
End Sub
 
M

Marc Butenko

Tony-

Try adding oWord.Quit to the end of the routine.


--
Marc Butenko
(e-mail address removed)

Tony Roost said:
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 spell check. However, the application is
leaving a trail of winword.exe processes running on the system.
PC is running W2000 SP3

The code and details of the form are detailed below. If anybody has any
ideas about a word around or another way to add spell checking capabilities
to my applications I would be grateful.
Thanks Tony


The form only contains one button and a text box. I have added a reference
to the com object 'Microsoft Word 9.0 Object Library' and imported it at the
top of the forms VB Page.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
 
G

Guest

Marc
Thanks for the sugguestion but it is already there (CType(oWord, Word._Application).Quit()). I have actually found a solution. I removed the following line :

oWord = CreateObject("Word.Application"

It seems that an instance of word is created when I create the word object (Dim oWord As New Word.Application())

Thanks again
Ton
 
N

norton

Hope it helps
http://support.microsoft.com/default.aspx?scid=kb;EN-US;306682

Norton

Tony Roost said:
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 spell check. However, the application is
leaving a trail of winword.exe processes running on the system.
PC is running W2000 SP3

The code and details of the form are detailed below. If anybody has any
ideas about a word around or another way to add spell checking capabilities
to my applications I would be grateful.
Thanks Tony


The form only contains one button and a text box. I have added a reference
to the com object 'Microsoft Word 9.0 Object Library' and imported it at the
top of the forms VB Page.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
 

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