473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

References to WINWORD.EXE still alive.

Hi,

I am diligently releasing (Marshal.Releas eComObject (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 there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?

Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?

Thanks for any information you can give me.
Robin.
Nov 21 '05 #1
2 4209
You should always call Quit.
Because it's an out of process server, rather than an in-process server,
releasing references will not unload the application, you will need to
explicitly call the quit. Be careful that winword isn't prompting for user
input too, this will cause it to hang and not unload.
"Robin Tucker" <id************ *************@r eallyidont.com> wrote in
message news:cs******** ***********@new s.demon.co.uk.. .
Hi,

I am diligently releasing (Marshal.Releas eComObject (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 there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?

Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?

Thanks for any information you can give me.
Robin.

Nov 21 '05 #2
Yes, objWord.Quit for example & then to double-check objWord = Nothing

Obviously, I am using objWord as a variable to explain a point. You should
change it to whatever you've called it

"Lance Wynn" wrote:
You should always call Quit.
Because it's an out of process server, rather than an in-process server,
releasing references will not unload the application, you will need to
explicitly call the quit. Be careful that winword isn't prompting for user
input too, this will cause it to hang and not unload.
"Robin Tucker" <id************ *************@r eallyidont.com> wrote in
message news:cs******** ***********@new s.demon.co.uk.. .
Hi,

I am diligently releasing (Marshal.Releas eComObject (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 there somewhere).
So my question is: are there any tools or is there any programmatic method I
can use to determine whether or not I have any references to this process
alive as a result of my code?

Oddly, even after I quit my program, WINWORD.EXE remains in memory.
However, if after creating my report, viewing it and then manually closing
WORD I check the task manager, it has mysteriously gone. Should I therefore
always call "quit" on the application object model, or will just releasing
the reference to it suffice?

Thanks for any information you can give me.
Robin.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2246
by: Mike MacSween | last post by:
I've done an Access app that does some Word automation. The code is long but the meat of it is: Sub testword() Dim wrdapp As Word.Application Set wrdapp = New Word.Application wrdapp.Visible = True End Sub Early binding, yes?
0
1406
by: Just D. | last post by:
Guys, I'm writing the Windows Application and one of the ideas is to use a RichText field to store/show some formatted text, probably with pictures. The problem is that this RichEdit control is very poor and I'd like to use WinWord for significant editing. I also don't want to exclude the RichEdit control for some light changes of the same text. So the problem is to start WinWord so that the main application should be frozen until...
3
11736
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...
2
1546
by: Matthew Herrmann | last post by:
Hi, I've heard from groups that listeners to event handlers cause references to be kept alive, if the targets are marked to stay alive. I need to make sure that attaching events to objects will not cause them to be kept open. I created a test which has "target" listening to "source" for events. After plugging source into target, I then let go of source. Since I'm still holding onto target, if delegates were a strong reference, then
2
1248
by: MikeP | last post by:
Hi there, This is actually (probably) a C# or .NET issue. I'm working on an VS 2005 AddIn and at one point I'm caching all "EnvDTE80.ErrorItem" objects that result from compiling one or more projects in an arbitrary solution (which my own code carries out). These objects simply store each warning, error or other message as seen in the "Error List" window in VS (when you build a solution). Later on, when I attempt to look at the...
1
2059
by: tvjraman | last post by:
Visual Basic 6 I use Getobject() to get the object of Word application. I always get the first instance of Winword.exe I have a macro in another instance of Winword.exe I need to get the object of the second or third instance of Winword.exe
0
1868
by: richard.krehbiel | last post by:
I've been googling for half a day now and have found answers on both sides of the argument. Baiscally it's this: I am using PHP 5.0.4 (I can upgrade if that's a solution) as an ISAPI module under IIS (Windows Server 2003). Each transaction to my PHP page returns "Connection: close", i.e. Keep-Alive isn't working. I've seen references that say Keep-Alive doesn't work at all with PHP as an ISAPI filter. I've seen other notes saying that...
2
2799
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):
2
3344
ajester
by: ajester | last post by:
I need WinWord to look like it's being executed from the correct path: C:\Program Files\Microsoft Office\Office12\WinWord.exe when in reality it's being launch from a Java app using the path C:\Program Files\Microsoft Office\Office11\WinWord.exe. A program (Java) from the Internet (so it only knows the configuration it has stored) launches 'C:\Program Files\Microsoft Office\Office11\Winword.exe' and sends it a macro to build a form on the...
0
9031
jinu1996
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...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
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...
0
7739
agi2029
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...
1
6528
isladogs
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...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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 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.