OLE Automation : Office 97

  • Thread starter Thread starter Venugopal Vemuri
  • Start date Start date
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
 
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
 
Back
Top