OLE Automation : Office 97

V

Venugopal Vemuri

Hi,
I am using the below said code to open word application
object:

Dim omWordObj As Object
Set omWordObj = CreateObject("Word.Application")

After this I open a document:

With omWordObj
.Documents.Open ("C:\test.doc")
End With

Finally quit the word application :

omWordObj.quit

Now here is the issue. Sometimes omWordObj.quit does not
work and throws a message "Do you want to save changes to
C:\test.doc" with yes, no and cancel option.

Is this a bug with ms word 97 application? I do have
office XP at my end which I can install if it going to
fix the issue.

An early reply would be appreciated.

Regards,
Venugopal
 
G

Gerald Stanley

You will get the message if there are any open documents
that have not been saved. To automatically save the
documents then quit Word, try
omWordObj.quit wdSaveChanges

Hope This Helps
Gerald Stanley MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top