View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
alborg alborg is offline
external usenet poster
 
Posts: 67
Default WORD.EXE open multiple times in task manager

Hi Jim:

This behavior usually happens when through automation you invoke MS Word by
using another software, s.a. MS Access. It can also occur if MS Word closes
suddenly and unexpectedly not leaving time to remove the instance of MS Word.

In one of my Word Templates, for example, I callup MS Access, often leaving
numerous instances of MSACCESS.EXE. For this problem, I solved it by going to
the VBA platform (View- Toolbars- Visual Basic). Then going to my
application folder- My Document area I put this code:

'------------------------------------
Private Sub document_Close()
'Check if Access is running
'I need to check if Access is running and then Quit the aplication. If the
create
'option is used to open an instance, the NetOffice add-in is not
included and it is needed
'for this particular module. All other modules do not require the
NetOffice add-in and
'can use the normal CreateObject function... alborgggg
Dim accessword As Access.Application
Dim Accesswasnotrunning As Boolean
On Error Resume Next
Repeat:
Set accessword = GetObject(, "Access.Application")
If Err = 0 Then
'Access was running
Accesswasnotrunning = True
accessword.Quit
Set accessword = Nothing
GoTo Repeat
End If
End Sub
'------------------------------------

Even if there are 4 instances of MSACCESS.EXE, it'll kill them all.

Here is how the VBA code window would look like:
http://i38.photobucket.com/albums/e1.../closeform.png

What YOU can do, first of all is to delete your Normal.dot template to make
sure that it is not corrupted. If it's OK, then open normal.dot and in its My
Document area place this code:

'------------------------------------
Private Sub document_Close()
Dim oword As Word.Application
Dim Accesswasnotrunning As Boolean
On Error Resume Next
Repeat:
Set oword = GetObject(, "Word.Application")
If Err = 0 Then
'Access was running
Accesswasnotrunning = True
oWord.Application.Quit()
Set oWord = Nothing
GoTo Repeat
End If
End Sub
'------------------------------------

Alternatively, you can simply delete that one instance on close:

'------------------------------------
Private Sub document_Close()
oWord.Application.Quit()
Set oWord = Nothing
End Sub
'------------------------------------

What gets me is that I can't replicate your problem on my machine, which is
set up pretty much like yours. Theoretically, though, the above should work.

Cheers,
Al

"jimrinflorida" wrote:

I have XP MCE 2002 SP3 w/Office 2003 Pro SP3 installed fresh on a new hard
drive. All Windows/Office updates available have been installed and Office is
activated. When I close Word it never truly closes in task manager. I have
also noticed that Outlook does not close either in task manager and on the
3rd time trying to open it the program freezes unless all instances are
closed in task manager. I removed Word as the editor in Outlook so that
another instance of Word would not start every time Outlook opens. I am
trying to figure why default installations of Office 2003 cause Word and
Outlook not to close (but look like the do). Outlook doesn't even have an
email account setup yet. This is home network. Very simple here. I can have
as many as 8 instances of WINWORD.EXE with all windows closed. (PPOINT,
EXCEL, and PUBL all close ok). I have a laptop with the same issues as well.
Any help would be appreciated!!