Stop template "Save Changes"

D

Dan Kelly

We have a number of standard templates sat on a Network Share and pointed at
by the Workgroup Templates setting in Word 2000.

All of the templates are marked as Read Only in their file properties.

All the templates can be used by many people.

One template in particular insists on asking you if you want to "Save
Changes to blank.dot" when you save documents created using it. Of course it
then sulks when it finds the document is read-nly.

Any suggestions on how to stop it asking?
 
J

Jean-Guy Marcil

Dan Kelly was telling us:
Dan Kelly nous racontait que :
We have a number of standard templates sat on a Network Share and
pointed at by the Workgroup Templates setting in Word 2000.

All of the templates are marked as Read Only in their file properties.

All the templates can be used by many people.

One template in particular insists on asking you if you want to "Save
Changes to blank.dot" when you save documents created using it. Of
course it then sulks when it finds the document is read-nly.

Any suggestions on how to stop it asking?

That template must have macro(s) whose code changes the template itself.

What is that code?
It may be possible to re-write it to avoid that problem.

If not, right after that code that changes the template, add this line:

ThisDocument.Saved = True

This will tell Word that the code container (ThisDocument = the template
itself) does not need to be saved.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Dan Kelly

There shouldn't be any code on that template at all - however there are a
number of Macros on the Normal template that could be causing the problem.

I'll check the template and post some code on Monday
 
D

Dan Kelly

The particular Macro that seems to cause the problem is the following:

Public Sub Numbered()
'
' Change
'
If Selection.Style <> ActiveDocument.Styles("Numbered") Then
Selection.Style = ActiveDocument.Styles("Numbered")
CommandBars("Formatting").Controls("NumList").State = msoButtonDown
Else
Selection.Style = ActiveDocument.Styles("Normal")
CommandBars("Formatting").Controls("NumList").State = msoButtonUp
End If

End Sub

This mimics the "Numbered" button and toggles either the Numbered or Normal
Styles, and toggles the button on/off.

It's part of the Global.dot, but seems to confuse the current template e.g.
blank.dot
 
J

Jean-Guy Marcil

Dan Kelly was telling us:
Dan Kelly nous racontait que :
The particular Macro that seems to cause the problem is the following:

Public Sub Numbered()
'
' Change
'
If Selection.Style <> ActiveDocument.Styles("Numbered") Then
Selection.Style = ActiveDocument.Styles("Numbered")
CommandBars("Formatting").Controls("NumList").State =
msoButtonDown Else
Selection.Style = ActiveDocument.Styles("Normal")
CommandBars("Formatting").Controls("NumList").State =
msoButtonUp End If

End Sub

This mimics the "Numbered" button and toggles either the Numbered or
Normal Styles, and toggles the button on/off.

It's part of the Global.dot, but seems to confuse the current
template e.g. blank.dot

When modifying toolbars and menu, it is highly advisavle to specify a
customizatin context.
See
Application.CustomizationContext
in the VBA help.

You are modifying a toolbar button, Word has to store the change somewhere
but you are not specifying where, so Word takes a guess... and ghoes for the
currently active template.

Also, if you do not want to bother the user with prompts asking to save a
template, op top of specifying .CustomizationContext, you should add:
ThisDocument.Saved = True
after
End If
so that Word will not see the global template as "dirty".

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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