changing menu causes template change?

G

Gary Hillerson

I distribute a template that users base new documents on. The template
"installs" a menu in Word's main menu bar.

In a certain circumstance, I disable my menu. However, after I do
this, when the user closes the document, Word asks if he wants to save
changes to the (attached) template.

So, Word "thinks" that disabling the menu is modifying the template
instead of just the document based on the template. Is there a way to
disable the menu without this happening, or a way to subsequently tell
Word that the template hasn't changed?

thanks
gary
 
C

Cindy M -WordMVP-

Hi Gary,

Are you setting the CustomizationContext when you create the menu? And
when you disable it? You have to tell Word where to save the changes
made to toolbars. And setting the state to disabled does change the
"container file" where the menu was created.
I distribute a template that users base new documents on. The template
"installs" a menu in Word's main menu bar.

In a certain circumstance, I disable my menu. However, after I do
this, when the user closes the document, Word asks if he wants to save
changes to the (attached) template.

So, Word "thinks" that disabling the menu is modifying the template
instead of just the document based on the template. Is there a way to
disable the menu without this happening, or a way to subsequently tell
Word that the template hasn't changed?

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 :)
 
C

Chad DeMeyer

Gary:

Set oTemplate = ActiveDocument.AttachedTemplate
'disable menu here
oTemplate.Saved = True
Set oTemplate = Nothing

Regards,
Chad
 
P

Peter Hewett

Hi All

You can do it in one line:
ActiveDocument.AttachedTemplate.Saved = True

Microsoft in their wisdom decided that the AttachedTemplate is a Variant rather than a
Template object, which means intellisense does not work - but the code does!

HTH + Cheers - Peter
 

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