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(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Clic
checkSpell(Me.T extBox1.Text
End Su
Private Sub checkSpell(ByVa l strText
Dim oWord As New Word.Applicatio n(
Dim oDoc As Word._Documen
' Check the spelling.
' If the spelling is incorrect then do the full word document thing..
If Not oWord.CheckSpel ling(strText) The
oWord = CreateObject("W ord.Application "
oWord.Visible = Tru
oDoc = oWord.Documents .Ad
oDoc.Range.Text = Me.TextBox1.Tex
' Setup the option
With oWord.Applicati on.Option
.CheckGrammarWi thSpelling = Tru
.SuggestSpellin gCorrections = Tru
End Wit
' Check the spellin
oDoc.CheckSpell ing(
' Return the value back to the text bo
Me.TextBox1.Tex t = 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(Fals e
End I
' Tidy up the allocations..
Tr
' Quit the word applicatio
CType(oWord, Word._Applicati on).Quit(
oDoc = Nothin
oWord = Nothin
Catch excp As Exceptio
End Tr
End Sub 5 6691
Tony-
Try adding oWord.Quit to the end of the routine.
--
Marc Butenko mb******@bresna n.net
"Tony Roost" <an*******@disc ussions.microso ft.com> wrote in message
news:67******** *************** ***********@mic rosoft.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
checkSpell(Me.T extBox1.Text)
End Sub
Private Sub checkSpell(ByVa l strText) Dim oWord As New Word.Applicatio n() Dim oDoc As Word._Document
' ' Check the spelling. ' If the spelling is incorrect then do the full word document
thing... ' If Not oWord.CheckSpel ling(strText) Then oWord = CreateObject("W ord.Application ")
oWord.Visible = True oDoc = oWord.Documents .Add
oDoc.Range.Text = Me.TextBox1.Tex t ' ' Setup the options '
With oWord.Applicati on.Options .CheckGrammarWi thSpelling = True .SuggestSpellin gCorrections = True End With ' ' Check the spelling ' oDoc.CheckSpell ing() ' ' Return the value back to the text box ' Me.TextBox1.Tex t = 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(Fals e)
End If ' ' Tidy up the allocations... ' Try
' ' Quit the word application ' CType(oWord, Word._Applicati on).Quit() oDoc = Nothing oWord = Nothing Catch excp As Exception
End Try End Sub
Tony-
Try adding oWord.Quit to the end of the routine.
--
Marc Butenko mb******@bresna n.net
"Tony Roost" <an*******@disc ussions.microso ft.com> wrote in message
news:67******** *************** ***********@mic rosoft.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
checkSpell(Me.T extBox1.Text)
End Sub
Private Sub checkSpell(ByVa l strText) Dim oWord As New Word.Applicatio n() Dim oDoc As Word._Document
' ' Check the spelling. ' If the spelling is incorrect then do the full word document
thing... ' If Not oWord.CheckSpel ling(strText) Then oWord = CreateObject("W ord.Application ")
oWord.Visible = True oDoc = oWord.Documents .Add
oDoc.Range.Text = Me.TextBox1.Tex t ' ' Setup the options '
With oWord.Applicati on.Options .CheckGrammarWi thSpelling = True .SuggestSpellin gCorrections = True End With ' ' Check the spelling ' oDoc.CheckSpell ing() ' ' Return the value back to the text box ' Me.TextBox1.Tex t = 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(Fals e)
End If ' ' Tidy up the allocations... ' Try
' ' Quit the word application ' CType(oWord, Word._Applicati on).Quit() oDoc = Nothing oWord = Nothing Catch excp As Exception
End Try End Sub
Marc
Thanks for the sugguestion but it is already there (CType(oWord, Word._Applicati on).Quit()). I have actually found a solution. I removed the following line :
oWord = CreateObject("W ord.Application "
It seems that an instance of word is created when I create the word object (Dim oWord As New Word.Applicatio n())
Thanks again
Ton
Marc
Thanks for the sugguestion but it is already there (CType(oWord, Word._Applicati on).Quit()). I have actually found a solution. I removed the following line :
oWord = CreateObject("W ord.Application "
It seems that an instance of word is created when I create the word object (Dim oWord As New Word.Applicatio n())
Thanks again
Ton
Hope it helps http://support.microsoft.com/default...b;EN-US;306682
Norton
"Tony Roost" <an*******@disc ussions.microso ft.com> ¦b¶l¥ó
news:67******** *************** ***********@mic rosoft.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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
checkSpell(Me.T extBox1.Text)
End Sub
Private Sub checkSpell(ByVa l strText) Dim oWord As New Word.Applicatio n() Dim oDoc As Word._Document
' ' Check the spelling. ' If the spelling is incorrect then do the full word document
thing... ' If Not oWord.CheckSpel ling(strText) Then oWord = CreateObject("W ord.Application ")
oWord.Visible = True oDoc = oWord.Documents .Add
oDoc.Range.Text = Me.TextBox1.Tex t ' ' Setup the options '
With oWord.Applicati on.Options .CheckGrammarWi thSpelling = True .SuggestSpellin gCorrections = True End With ' ' Check the spelling ' oDoc.CheckSpell ing() ' ' Return the value back to the text box ' Me.TextBox1.Tex t = 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(Fals e)
End If ' ' Tidy up the allocations... ' Try
' ' Quit the word application ' CType(oWord, Word._Applicati on).Quit() oDoc = Nothing oWord = Nothing Catch excp As Exception
End Try End Sub This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 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...
|
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 the visibility, true.
Hope someone can help me.
Richard Loupatty
|
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 finished using the WINWORD.EXE com
server, I still have a reference to it hanging somewhere in my code (I know
this because it remains in task manager). I have checked and double checked
but can't find it (although of course I am sure it must be...
|
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
suggestions. 1) Check the file permissions for the document or drive. 2)
Make sure there is sufficient free memory and disk space. 3) Open the file
with the Text Recovery converter."
The document that I want to display is on my PC and was created by...
|
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
suggestions. 1) Check the file permissions for the document or drive. 2)
Make sure there is sufficient free memory and disk space. 3) Open the file
with the Text Recovery converter."
The document that I want to display is on my PC and was created by...
| |
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 code:
private void button1_Click(object sender, System.EventArgs e)
{
Word.ApplicationClass w1 = new Word.ApplicationClass();
|
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 our development server only as we are still
using Office 2000 components in production. No probs in production with
the current code which has been in use for a couple of years now.
|
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 permissions. But the problem is that I added
all required permissions first - using Component Services, second - to NTFS
permissions. It still doesn't work as expected. I saw many articles on the
Internet, the best ones were about DCOMCNFG.EXE and its...
|
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 we give continous print from that word application thro our printer driver the handle count increases. But it is not returning to the original handle count. Everytime after the print job it returns to some constant value. This value is same for all...
|
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 = Process.GetProcessesByName("winword")
'For i As Integer = 0 To proc.Count - 1
' proc(i).CloseMainWindow()
'Next i
'this closes all WinWord processes silently (a little overkill):
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |