Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

relative paths for templates

348 views
Skip to first unread message

Sam Deane

unread,
Jun 27, 2003, 9:41:34 AM6/27/03
to
Is there any way to specify the template of a document using a
relative path.

I can only find a way to set a template using an explicit path, which
obviously doesn't work when moving a document between machines, and is
even less use when moving between the mac & the pc.

I am trying to set things up so that I can check documents in to our
source control system, and have a standard "house style" template
which is also in the source control system.

Surely there must be a way?

John McGhie [MVP - Word]

unread,
Jun 27, 2003, 8:53:55 PM6/27/03
to
Hi Sam:

By far the easiest way is to place the template in the same folder as the
document. This takes advantage of an undocumented feature of Word: Word
searches a "hierarchy" of locations looking for the document template. The
FIRST place it looks is the document folder. If the correctly-named
template is found there, it will be used without any reference to any other
path that may be stored in the document.

The "proper" way to do this is to lodge the template on the network in a
folder to which all have read access. Each user must then configure
Word>Preferences>File Locations to set "Workgroup Templates" up to point at
that location.

Each document must then be checked in with the template attached
Tools>Templates and Add-ins>Attach from the network location. Once that
link is made, it will stay there for any user that has the location
correctly mapped to Workgroup Templates. For other users, Word "remembers"
the location and will re-attach the template when the document is next
opened on a computer that has the Workgroup Templates location correctly
specified.

To make this deal easier, use UNC naming ////<server name>/<Shar
name>/<path>/Template.dot

If you have UNC naming enabled on your network, this will always work.

Users who work off-line need to learn to add the template to their User
Templates location (Word>Preferences>File Locations>User Templates). Word
will always look here as its third stop when trying to find the template.
But this can give you a version control problem, in that once Word finds the
template in the user's local location, it will always use that one. If you
update the template on the server, that user may not notice.

You can alternatively place a macro in the document that "finds" and
attaches the template on Open. This is not as satisfactory, because unless
your users have their Macro security set to "Low" the macro can't run. If
they do have it set to Low, any Internet Nasties can run. On the PC you can
overcome this by "signing" the macro with a digital certificate which each
user can then trust, but code signing is not supported on the Mac.

Me? I tend to go with dropping the template into the document folder: it
always works :-) You user will get a Macro Warning whenever they open the
document. They need to be trained to say "Yes".

Cheers

This responds to microsoft.public.mac.office.word on 27 Jun 2003 06:41:34
-0700, s...@elegantchaos.com (Sam Deane):

All Spam blocked with SpamNet: a free download from http://www.cloudmark.com/

Please post all comments to the newsgroup to maintain the thread.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:jo...@mcghie-information.com.au

Sam Deane

unread,
Jul 1, 2003, 1:25:12 PM7/1/03
to
Hi John, thanks for the response.

> By far the easiest way is to place the template in the same folder as the
> document. This takes advantage of an undocumented feature of Word: Word
> searches a "hierarchy" of locations looking for the document template. The
> FIRST place it looks is the document folder. If the correctly-named
> template is found there, it will be used without any reference to any other
> path that may be stored in the document.

Unfortunately we have lots of documentation, in a hierarchy of
folders, all wanting to share the same template, so the drop-it-in
solution won't work.



> The "proper" way to do this is to lodge the template on the network in a
> folder to which all have read access. Each user must then configure
> Word>Preferences>File Locations to set "Workgroup Templates" up to point at
> that location.

So I need to actually put the template on a remote volume and mount it
on everyone's machine? It's not enough to just place it in the
Workgroup templates folder and rely on a similar file being picked up
in the user's workgroup templates (even if their workgroup templates
is actually mapped to a different local folder)?

All sounds a bit icky :)

Whilst I'm at it, what does word to when trying to save changes to a
template that is locked? Because the template is under source control,
it will typically be a locked file unless the user has remembered to
open it for edit in the source control system! It would be handy if
word throws up a dialog - that should be enough to remind the user to
open the template for editing. But experimentation seems to suggest
that word just quietly does something... either fails to write or
overwrites... I haven't got round to working out which!

Cheers,

- Sam -

John McGhie [MVP - Word]

unread,
Jul 2, 2003, 2:25:07 AM7/2/03
to
Hi Sam:

This responds to microsoft.public.mac.office.word on 1 Jul 2003 10:25:12
-0700, s...@elegantchaos.com (Sam Deane):

> So I need to actually put the template on a remote volume and mount it
> on everyone's machine? It's not enough to just place it in the
> Workgroup templates folder and rely on a similar file being picked up
> in the user's workgroup templates (even if their workgroup templates
> is actually mapped to a different local folder)?

That's correct. If a document has an Attached Template (which it will have
if it were created from that template) AND the template is on the network,
it will remain attached when the document is opened on any machine that can
see that template folder.

If the Attached Template location is not available, Word will search a
variety of places, including User Templates, for a template of the same
name. One other undocumented location you can use is the location of the
Word program file (if your users are installed to run from network). Any
template found there will be used, but this is very poor network
administration practice.

You can get more information here:
https://mvp.support.microsoft.com/default.aspx?scid=kb;EN-US;214215

This article is about Word 2000 on the PC, which has very similar behaviour
to Word X on the Mac.

HOWEVER, the Network folder MUST be the user's Workgroup Templates folder in
order to disable the macro warning. There are only two "Trusted" locations:
User Templates and Workgroup Templates.

Any template that contains anything other than text and styles in any
location other than those two will trigger the Macro warning.

If a template does not contain anything that triggers the macro warning, you
could ask why bother with it: no further reference will be made to it after
document creation unless there is some kind of active or dynamic content:
e.g. a macro, toolbar, customised keystrokes, or an AutoText that requires
Word to access the template.

If the macro warning is triggered, and the user says No, Word will silently
strip the customisation from the template. If the user can then Save the
template, you've lost it for good.


>
> All sounds a bit icky :)

If that's your description of "A stupidly deficient design" then yes, I
would agree :-)

> Whilst I'm at it, what does word to when trying to save changes to a
> template that is locked?

Error message. Tell your users to simply ignore the message. The document
save has by then completed successfully.

> Because the template is under source control,
> it will typically be a locked file unless the user has remembered to
> open it for edit in the source control system!

Do not permit that: you will have massive version-control problems. The
last one to log off at night will define the template for everyone next
morning. Hang on... You said you had a user-base of "Developers"??? This
peculiar species NEVER logs off, so YOU will NEVER be able to update your
templates unless you bounce the server :-)

The correct way to handle this is to lodge your templates in a read-only
folder. You then have to find a way around the fact that on Windows, Word
opens read-only files with an Exclusive lock, which means that while ANY
copy of Word has a document open that is attached to the template, the
template will be locked Read-only Exclusive, which will prevent you getting
the template in Edit to update it. Some file servers allow you to drop the
update in under a different file name, and then rename the old and rename
the new to overcome this. If yours doesn't, you will have to disconnect the
users from the Share in order to get your update in. You can do this while
users have the template open: they will probably not notice because Word
will transparently re-try and reconnect when it can. Some will get a dialog
telling them that this has happened.

> It would be handy if
> word throws up a dialog - that should be enough to remind the user to
> open the template for editing. But experimentation seems to suggest
> that word just quietly does something... either fails to write or
> overwrites... I haven't got round to working out which!

If you have one of the "Transparent" source control systems such as MS
Visual Source Safe, VSS will silently check the template out, update it and
check it back in. If Word cannot get an Edit lock on the template, the user
will be prompted to save a copy of the template.

Hope this helps

0 new messages