No, that's not it I'm afraid. This affect closing the document - I want a
macro that will halt the Exiting of the application completely. So far I
have come up with:
Sub AutoExit()
response = MsgBox("Do you want to quit Word?", vbYesNo)
If response = vbYes Then Application.Quit
End Sub
However, I need something just before the End Sub to halt the exiting of
Word. At the moment it quits anyway.
Steve Wylie
Hi Steve,
I see your point. Neither AutoExit nor the application event handler
oApp_Quit (see http://word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm)
offers a Cancel parameter to stop the shutdown.
However, a userform's QueryClose event handler does have such a
parameter, so some clever folks have figured out that they can run a
dummy userform which, if it refuses to close, prevents the whole app
from shutting down. Here's a discussion of the technique in Access,
but something similar should work in Word:
http://dbforums.com/t362717.html
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
>No, that's not it I'm afraid. This affect closing the document - I want a
>macro that will halt the Exiting of the application completely. So far I
[quoted text clipped - 11 lines]
>
>Steve Wylie
Steve Wylie - 07 Nov 2004 16:32 GMT
Hmm. The Access solution is a bit too advanced for me, but it's given me an
idea about "forcing" Word to notify a user on shutdown.
If Normal.dot is changed (or thinks it's been changed) during a session,
there is a Word option to prompt about saving Normal.dot when Word closes.
What I need is a "transparent" way of changing/unchanging Normal.dot when
Word starts up, so a user can be told if they get the message and did not
intend to close Word down, they could just click Cancel and Word will not
shut down.
But how could I arrange for this to happen so the user would not have to do
anything themselves on startup? I don't really want them going into the VBA
editor and manually changing some macro text or other to force the
Normal.dot to change...
Steve Wylie
Jonathan West - 07 Nov 2004 16:41 GMT
> Hmm. The Access solution is a bit too advanced for me, but it's given me
> an
[quoted text clipped - 14 lines]
> editor and manually changing some macro text or other to force the
> Normal.dot to change...
You don't need to change normal.dot, you just need to kid Word into
believing it has been changed. This will do the trick
NormalTemplate.Saved = False
To make Word think that normal.dot hasn't been changed, do this
NormalTemplate.Saved = True

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Steve Wylie - 08 Nov 2004 18:29 GMT
Well, that will certainly work - thanks. I'll stick that in an AUTOEXEC
macro.
Steve