Problems closing instanced Word Objects and the Normal.dot file

P

Paul Willman

I have an application created in VB6 that takes data from a database and
creates and displays a Word document if the user chooses to. The program
creates a Word application object in order to display the document. The
problem I have is that when the user closes the Word instance, they are
prompted to save the changes to the document, and if they click no, they get
the error:

Normal.dot was being edited by another Word session. If you save this
document with the original name, you will overwrite any changes made in the
other session.

Do you want to save the document using the original name anyway?

Clicking no gives you the Windows file save dialog box, which you have to
cancel out of. They are then left with a Word instance with no document in
it. When they click on the X to close the app, they get the warning:

Changes have been madde that affect the global template, Normal.dot. Do you
want to save those changes? Clicking No finally makes it all go away.

Needless to say, this is a giant pain, and I need to know how to make this
stop.

I'm using VB6 with Windows XP and Microsoft Word 2002.

Thanks,

Paul
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?UGF1bCBXaWxsbWFu?=,

I take it you're starting a new instance of the Word application (as opposed to
re-using a running instance)?

See if putting this line in, just before the close down stuff runs, helps:

NormalTemplate.Saved = True

this should fool Word into believing any changes have been saved and avoid the
prompts.
I have an application created in VB6 that takes data from a database and
creates and displays a Word document if the user chooses to. The program
creates a Word application object in order to display the document. The
problem I have is that when the user closes the Word instance, they are
prompted to save the changes to the document, and if they click no, they get
the error:

Normal.dot was being edited by another Word session. If you save this
document with the original name, you will overwrite any changes made in the
other session.

Do you want to save the document using the original name anyway?

Clicking no gives you the Windows file save dialog box, which you have to
cancel out of. They are then left with a Word instance with no document in
it. When they click on the X to close the app, they get the warning:

Changes have been madde that affect the global template, Normal.dot. Do you
want to save those changes? Clicking No finally makes it all go away.

Needless to say, this is a giant pain, and I need to know how to make this
stop.

I'm using VB6 with Windows XP and Microsoft Word 2002.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
S

signell

I am astonished! I had the same problem but the "Saved" command did not
seem to work for me. What did work every time was to put a Sleep
command between the "wdApp.Quit" and the "Set ... = Nothing" commands.
I found that 1 sec works for a short file, 3 sec for a long one. The
time interval needed may thus depend on the speed of the computer as
well as the file length. I would sure be interested in hearing what's
going on in that interval!

- Pete
 

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