Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

WinWord.exe can not exit after automation in VB.

 
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming
View previous topic :: View next topic  
Author Message
kfengbest
Guest





PostPosted: Tue Nov 13, 2007 8:22 am    Post subject: WinWord.exe can not exit after automation in VB. Reply with quote

WinWord.exe can not exit after automation in VB. Here is the step:



1. Execute the following code in VB:

Private Sub Command1_Click()

Dim wrdapp As Word.Application

Set wrdapp = CreateObject("Word.Application")

wrdapp.Visible = True

Set wrdapp = Nothing

End Sub

2. Open a IE, Drag and drop a wor doc file into IE to make sure the
doc is open inside the IE

3. Close the standalone word application created in step 1, and then
close the IE.

4. Open Task Manager-> the WinWord.exe does not quit.



Of course , if we explicitly call Word.Application.Quit to quit word.exe
that may work.

But in our application we could not do that. Because after user opened a doc
using our program, he may close the program

and don't like the word to be closed with our program. He may want to edit
it that close it later.



And it seems that when using IE as host to open word document, it does not
reduce the reference count.

We need to do something additional to reduce the reference in somewhere. But
I have no idea yet currently.



Does anybody have any idea about how to solve it? Thanks in advanced.
Back to top
Google
Sponsor





PostPosted: Tue Nov 13, 2007 8:22 am    Post subject: Advertisement

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> microsoft word programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum