By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,724 Members | 863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,724 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Tony-

Try adding oWord.Quit to the end of the routine.
--
Marc Butenko
mb******@bresnan.net

"Tony Roost" <an*******@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
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

checkSpell(Me.TextBox1.Text)
End Sub

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

'
' Check the spelling.
' If the spelling is incorrect then do the full word document thing... '
If Not oWord.CheckSpelling(strText) Then
oWord = CreateObject("Word.Application")

oWord.Visible = True
oDoc = oWord.Documents.Add

oDoc.Range.Text = Me.TextBox1.Text
'
' Setup the options
'

With oWord.Application.Options
.CheckGrammarWithSpelling = True
.SuggestSpellingCorrections = True
End With
'
' Check the spelling
'
oDoc.CheckSpelling()
'
' Return the value back to the text box
'
Me.TextBox1.Text = oDoc.Range.Text
'
' Set the saved flag so that we don't get prompted to save the document ' that we are about to close.
'
oDoc.Saved = True
'
' Close the document
'
oDoc.Close(False)

End If
'
' Tidy up the allocations...
'
Try

'
' Quit the word application
'
CType(oWord, Word._Application).Quit()
oDoc = Nothing
oWord = Nothing
Catch excp As Exception

End Try
End Sub

Nov 22 '05 #2

P: n/a
Tony-

Try adding oWord.Quit to the end of the routine.
--
Marc Butenko
mb******@bresnan.net

"Tony Roost" <an*******@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
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

checkSpell(Me.TextBox1.Text)
End Sub

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

'
' Check the spelling.
' If the spelling is incorrect then do the full word document thing... '
If Not oWord.CheckSpelling(strText) Then
oWord = CreateObject("Word.Application")

oWord.Visible = True
oDoc = oWord.Documents.Add

oDoc.Range.Text = Me.TextBox1.Text
'
' Setup the options
'

With oWord.Application.Options
.CheckGrammarWithSpelling = True
.SuggestSpellingCorrections = True
End With
'
' Check the spelling
'
oDoc.CheckSpelling()
'
' Return the value back to the text box
'
Me.TextBox1.Text = oDoc.Range.Text
'
' Set the saved flag so that we don't get prompted to save the document ' that we are about to close.
'
oDoc.Saved = True
'
' Close the document
'
oDoc.Close(False)

End If
'
' Tidy up the allocations...
'
Try

'
' Quit the word application
'
CType(oWord, Word._Application).Quit()
oDoc = Nothing
oWord = Nothing
Catch excp As Exception

End Try
End Sub

Nov 22 '05 #3

P: n/a
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
Nov 22 '05 #4

P: n/a
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
Nov 22 '05 #5

P: n/a

Hope it helps
http://support.microsoft.com/default...b;EN-US;306682

Norton

"Tony Roost" <an*******@discussions.microsoft.com> bl
news:67**********************************@microsof t.com g...
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

checkSpell(Me.TextBox1.Text)
End Sub

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

'
' Check the spelling.
' If the spelling is incorrect then do the full word document thing... '
If Not oWord.CheckSpelling(strText) Then
oWord = CreateObject("Word.Application")

oWord.Visible = True
oDoc = oWord.Documents.Add

oDoc.Range.Text = Me.TextBox1.Text
'
' Setup the options
'

With oWord.Application.Options
.CheckGrammarWithSpelling = True
.SuggestSpellingCorrections = True
End With
'
' Check the spelling
'
oDoc.CheckSpelling()
'
' Return the value back to the text box
'
Me.TextBox1.Text = oDoc.Range.Text
'
' Set the saved flag so that we don't get prompted to save the document ' that we are about to close.
'
oDoc.Saved = True
'
' Close the document
'
oDoc.Close(False)

End If
'
' Tidy up the allocations...
'
Try

'
' Quit the word application
'
CType(oWord, Word._Application).Quit()
oDoc = Nothing
oWord = Nothing
Catch excp As Exception

End Try
End Sub

Nov 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.