MS Word locking problems due to Normal.dot file?

S

Sharper

Hello,

We have an ActiveX component which opens up MS Word from our
application to display documents. Some computers are experienceing an
issue saying that Normal.dot is in use by another user if they have 2
instances of WINWORD.exe running. This causes our application to hang.

Further investigation has revealed that on the computers where this
error occurs, the Normal.dot file is being saved every time Word exits.
For example, on my machine my last modified time stamp for Normal.dot
is near enough the time I installed Word. However, on a machine that
the problem occurs, the time stamp, is the last time they exited Word.

It seems as though a user has received the message along the lines of
"Normal.dot has been modified, would you like to save Normal.dot" and
hit "yes, every time" (I've not seen these messages but have read about
them on other posts).

What we really need to do, I think, is ensure that Normal.dot is not
saved at all. Is there any way to do this through Word, except through
uninstall->re-install?

We are running Word 2000 on XP with up-to-date virus defs. and regular
scans (i.e. Virus unlikely).

I have posted a message similar to this on a couple of other groups and I
have had feedback along the lines of "this is how Normal.dot works", "here is
a tool for analyzing word", which has been great, but no one knows how to
repair the problem. Do you know?

Thanks in advance for all assistance received. This has been giving me
many sleepless nights!!!


Cheers,


Stephen Harper
 
J

John McGhie

Hi Stephen:

Go to Tools>Options>Save and uncheck "Prompt to save Normal template". This
will enable Word to save the Normal template whenever it feels like it, and
will lessen the problem.

However, since you do not want to make a save to Normal, and you are playing
around in code anyway, include the following line just before your Exit
statement

NormalTemplate.Saved = True

That "declares" Normal to have already been saved, so Word will close that
instance without attempting to save it. Note: this is VBA, not ActiveX, in
ActiveX the Application.NormalTemplate property won't be there: it's
specific to Word.

Don't be tempted to use Documents.Close SaveChanges:=wdDoNotSaveChanges ,
because although that will close documents, Word won't let you close Normal
template because it's one of Word's scratch files.

You could instead add an AutoClose and an AutoExit macro to the offending
Normal template containing just that line. These macros execute on the
Document Close event just before the application quits and have the same
effect. However, this is pretty cheap-and-nasty code design. It prevents
any of the user's changes being saved to Normal, so it won't be long before
the users come looking for you, and they won't be very happy. If some other
coder sees what you've done, your reputation will not be enhanced :)

Far better to code your application to check for an existing instance of
Word and use that one if found. Getting a user into a situation where he
has two instances of Word running is not really great application design :)

Normal is the user's personal storage scratchpad, and it will update
constantly as the user changes settings and preferences. So the poster who
told you "this is the way Normal template works" was correct.

I am surprised that the people over at
microsoft.public.word.vba.customization did not tell you all of this. This
is a Macintosh Word newsgroup, and few of us would know the answer to such a
question -- we do AppleScript here :)

Hope this helps

Hello,

We have an ActiveX component which opens up MS Word from our
application to display documents. Some computers are experienceing an
issue saying that Normal.dot is in use by another user if they have 2
instances of WINWORD.exe running. This causes our application to hang.

Further investigation has revealed that on the computers where this
error occurs, the Normal.dot file is being saved every time Word exits.
For example, on my machine my last modified time stamp for Normal.dot
is near enough the time I installed Word. However, on a machine that
the problem occurs, the time stamp, is the last time they exited Word.

It seems as though a user has received the message along the lines of
"Normal.dot has been modified, would you like to save Normal.dot" and
hit "yes, every time" (I've not seen these messages but have read about
them on other posts).

What we really need to do, I think, is ensure that Normal.dot is not
saved at all. Is there any way to do this through Word, except through
uninstall->re-install?

We are running Word 2000 on XP with up-to-date virus defs. and regular
scans (i.e. Virus unlikely).

I have posted a message similar to this on a couple of other groups and I
have had feedback along the lines of "this is how Normal.dot works", "here is
a tool for analyzing word", which has been great, but no one knows how to
repair the problem. Do you know?

Thanks in advance for all assistance received. This has been giving me
many sleepless nights!!!


Cheers,


Stephen Harper

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 
S

Sharper

Yip, I noticed it was a mac grouop straight after I had submitted the question.

However, your answer was great and should be very helpful.

The problem is that we are using an existing ActiveX control which offers
basic functionality for Word. Essentially all we can do is set a property's
status, e.g. visible to false or true, custom fields to a given values, etc.
It has been poorly documneted and I am working with existing code, so I am
unaware of any way to check for an existing instance of Word running.

I think I have made enough excuses for myself.

Thanks again

Stephen Harper
 

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