View Single Post
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default

Stuart wrote:
I have a template with just 2 Sections. The 1st section
is protected (and contains fields accessible to the user), the 2nd is
not protected.

When a user opens the template, they are actually opening a copy of
the template (as is true for a standard
document). If the user makes changes to the copy and saves it with a
different name, then the template is preserved unchanged. If however
they make changes but save it with the original template's name, then
the template will be overwritten.......I believe this to be correct?

Can I stop this without using code, please? (I wish to avoid the macro
warning/Certificates issue, if possible).

If not, then I'm going to have to use code...perhaps a test for the
'Save name' in the Document_BeforeClose Event
(if that event exists in the Word Object model).

Regards.


Hi Stuart,

Users are *not* supposed to "open" the template. They're supposed to place
the template file in their Templates folder and use File New to create new
documents *based* on the template. That avoids the whole messy situation, as
the template is never altered (except in a few situations that are best
avoided, such as having "Add to template" checked in the Modify Style
dialog).

The best course is one of education -- if a user opens and alters the
template, beat him or her about the head and shoulders with stinging
nettles. :-)

If you can't change that behavior, the next choice is to set the template
file as read-only or place it in a folder to which ordinary users are given
read access but not write access.

If you need to use macro code, make sure the users all go to Tools Macro
Security, click the Trusted Publishers tab, and check the box for "Trust all
installed add-ins and templates". When you put the template containing code
into the Templates folder (which is a trusted location), there won't be any
warning or any requirement for a certificate. The macro can check whether
ActiveDocument.Type is wdTypeTemplate and, if so, display a warning and
close the template. See
http://groups-beta.google.com/group/...ea8b70f3a22342
for a sample macro.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org