473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
5 6649
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
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
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
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

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

Norton

"Tony Roost" <an*******@discussions.microsoft.com> ¦b¶l¥ó
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tony Roost | last post by:
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...
2
by: Richard Loupatty | last post by:
I tried to start winword.exe from an aspx (after granting things with dcomcnfg) and i can see winword.exe showing up in the taskmanager, but i don't see the word-application itself. I did set...
2
by: Robin Tucker | last post by:
Hi, I am diligently releasing (Marshal.ReleaseComObject (o) ) all references I pick up while generating a report using VB.NET in my software. At least, I *think* I am. However, when I have...
3
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
2
by: Dean Slindee | last post by:
The code below is being used to launch WinWord.exe from a VB.NET program. Word launches, but displays this error message: "Word has experienced an error trying to open the file. Try these...
1
by: Paguro Bernardo | last post by:
Hi everybody, I'm encountering some problem in trying to activate more than one instance of Word from C#. To keep it simple, I have a stupid Form, with just a button in it and the following...
3
by: James | last post by:
Howdy. I'm having difficulty getting winword.exe processes to die on our development server when using SET objWord = CreateObject("word.application") from an .ASP page. This problem exists on...
8
by: Just D. | last post by:
All, What exactly should we do to get WinWord working in asp.net? I wrote a class library and it works just great in WinApp. When I switched to the WebApp I can't get the object because of...
0
by: nandini123 | last post by:
Hi, Actually we are developing a printer driver. We have an issue with word application. The winword application will consume some amount of handles, which we will see in the task manager.If...
2
by: Dean Slindee | last post by:
Using this statement to utilize the spell checker in WinWord: WinOffice.clsWord.SpellChecker(txtNote.Text) 'this does not work because no main window is displayed 'Dim proc =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.