Is there any way to prevent Word from asking to save template?

G

Gary Hillerson

Is there any way I can trap a Save event and prevent Word from asking
the user if s/he wants to save the associated template?

This is a template I distribute and I can't understand how it changes
I don't understand why Word thinks the template has changed and can't
figure out how to prevent that. I create a new document based on the
template, make a single change to that document and then do a save as.
Word asks if I "also want to save changes to the document template."

And then, when I close the document, it asks about the template again.

I don't want users to get asked this question and definitely don't
want them re-saving the template.

Is there a way to prevent Word from asking, like trapping the Save
event and setting a flag that Word checks to False???

Thanks,
gary
 
G

Gary Hillerson

Sorry about the previous posting.

I figured out via a late-nite revelation that something was happening
in my AutoOpen and AutoNew functions and was able to work around it.

I'm still not sure why Word thinks the template has changed -- the
code verifies that the menu I want to display is displayed, and if
not, displays it in the new document. Eliminating that code eliminated
the problem, so I can work around it; I don't understand the whys, but
I can make it work, and that's good enuf.

g
 
T

Theo van der Ster

Gary Hillerson said:
Is there any way I can trap a Save event and prevent Word from asking
the user if s/he wants to save the associated template?

Hi Gary,

Try this:

Sub AutoClose()
ActiveDocument.AttachedTemplate.Saved = True
End Sub

For some reason, it doesn't always work, though. But it's the
"official" way to do it, as far as I know.

Regards,
Theo
 
J

JGM

Hi Gary,

If you change menus, then your template has been changed!

Also, can someone confirm this please, I am under the impression that under
some conditions, the act of declaring and modifying variables in a module
prompts Word to think that this is a template change...

Cheers!
 
W

Word Heretic

G'day Gary Hillerson <[email protected]>,

..CustomizationContext my friend

Gary Hillerson said:
Sorry about the previous posting.

I figured out via a late-nite revelation that something was happening
in my AutoOpen and AutoNew functions and was able to work around it.

I'm still not sure why Word thinks the template has changed -- the
code verifies that the menu I want to display is displayed, and if
not, displays it in the new document. Eliminating that code eliminated
the problem, so I can work around it; I don't understand the whys, but
I can make it work, and that's good enuf.

g

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

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