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

Update docs based o template

6 views
Skip to first unread message

Edson Roman

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to
I have a two sections template and hundreds of docs based on it.This
template is updated sometimes with small changes.
I want all my old docs based on new updated template.
Is there a fast way to do this other than cut and paste to new doc based
on new template?
In time, it's possible have a footer appear only in last page if my doc
is several pages long or i first page if my doc is only one page long?
TIA


Sent via Deja.com http://www.deja.com/
Before you buy.

John McGhie [MVP - Word]

unread,
Jul 15, 2000, 3:00:00 AM7/15/00
to

Edson:

In microsoft.public.word.docmanagement on Fri, 14 Jul 2000 23:12:08 GMT,
Edson Roman <rom...@my-deja.com> wrote:

> I have a two sections template and hundreds of docs based on it.This
> template is updated sometimes with small changes.
> I want all my old docs based on new updated template.
> Is there a fast way to do this other than cut and paste to new doc based
> on new template?

A simple enough request, isn't it! Unfortunately, Word won't do it.

You *can* make Word automatically update the styles from the template to the
document. If you attach the template with the "Automatically update styles"
field enabled, it will update the styles from the template each time the
document is opened. However, if the document contains bullets or numbering,
you MUST NOT set this feature or it will break all the lists in the
document. Which means it is useless for real-world documents.

Word is generally designed for smaller simpler documents such as are
produced by newbie users. I am conducting a running dialog with the Word
product design people to try to persuade them that it is time they had a
look out there in the real world to see how their product is actually being
used :-) They seem to have lost sight of the fact that EVERY user has to
handle a long, complex document sometime in their career.

OK, now the only way you are going to be able to accomplish this is with a
VBA macro. By the time you know enough VBA to write the macro, you will
know how to go about it.

Basically you need to create an AutoOpen macro in each template that
explicitly copies the settings you want from the template to the document
each time a document based on that template is opened. You need to handle
the condition where the properties you want to copy may already be up to
date. That's probably best done with a DOC Property that stores the date
you last updated each item.

> In time, it's possible have a footer appear only in last page if my doc
> is several pages long or i first page if my doc is only one page long?

Yes, it is. (Wow, what a beaut question... I had to think about this one!
I nearly had you writing conditional IF fields, then my brain rebooted...)

You need two section breaks. Since each document already has one, you need
to add one, right at the end. The document will now have two section breaks
(this is confusing...) One is where you added it, the other is below it,
hidden in the last paragraph mark of the document. You need to remember
this :-)

Go into View>Headers and Footers and click in the Footer.

Press the NEXT button until you are in the last footer.

Press the Same as Previous button until the footers are NOT linked. Make
sure you do not create any footers until you have unlinked the footers, or
the footer you create will appear on every page.

Create your footer in the SECOND section break.

Only the second (hidden) section break will generate a footer. It will
always appear on the LAST page of the document only. If the document
contains only one page, that's where it will appear.

Hope this helps.

Please post follow-up questions to the newsgroup so that all may follow the thread.

John McGhie <jo...@mcghie-information.com.au>
Consultant Technical Writer
Microsoft MVP (Word)
Sydney, Australia (GMT +10 hrs) +61 (04) 1209 1410

Damien Barkan

unread,
Jul 21, 2000, 3:00:00 AM7/21/00
to

John,

>You *can* make Word automatically update the styles from the template to the
>document. If you attach the template with the "Automatically update styles"
>field enabled, it will update the styles from the template each time the
>document is opened. However, if the document contains bullets or numbering,
>you MUST NOT set this feature or it will break all the lists in the
>document. Which means it is useless for real-world documents.

I tried to confirm this (in Word 97 SR-2), and couldn't. After
creating a document from a particular template, I checked
"Automatically update document styles" and saved and closed the
document. Then I went back to the template and made changes to some
styles in the stylesheet (including one that was bulleted), saved it
and closed.

(By the way, I was surprised to see that the changes I made in the
stylesheet did *not* affect paragraphs in the template, as they
normally do in a document when changing the stylesheet in the
document. Why's that?)

Then I opened the document again, and found that paragraphs in the
document that used the styles I had changed in the template not only
were not "broken" (though I'm not certain exactly what you meant by
that), but did *not" reflect the changes I had made in the stylesheet.

Next, I thought perhaps this was because these paragraphs in the
document originated in the template (i.e., the template had several
pages of paragraphs in it). So I deleted (in the document) all the
paragraphs, entered some new paragraphs and tagged them with styles,
and saved and closed the document. Then I made changeds in the styles
in the template, and saved and closed it. When I then opened the
document, the paragraphs tageed with the styles I had changed in the
stylesheet (bulleted paragraphs) *did* reflect the changes I had made
in the template's stylesheet.

So can you clarify just what you meant by "break" in "you MUST NOT set
this feature or it will break all the lists in the document"? And are
there certain conditions under which this happens and other conditions
where it does not happen?

Also (assuming I can use the conditions where it works properly), is
there some way I can have all documents created from a particular
template automatically default to "Automatically update document
styles" checked instead of unchecked (to ensure that documents written
by several writers in a team all have the same look, without calling
their attention to the mechanics of doing this)?

If so:

- Is there some way I can get that checked checkbox to be grayed out
so the user cannot uncheck it?

- Is there some way I can get a document created from a template on
the user's local drive to be automatically attached not to that local
template but to a template on a server (again, without the writer's
intervention)?

Thanks for your help!

Damien


Margaret Aldis

unread,
Jul 21, 2000, 3:00:00 AM7/21/00
to
Hi Damien - I think I missed the start of this thread but I may be able
to clarify some things.

Update styles from template is risky with standard Word bullets and
numbering. It is unpredictable, but sooner or later you will find that
the list formats ('List Templates') play 'musical chairs' - you might
see your bulleted lists change tabs or indents, or something more
bizarre (I once had a special list style that inserted the word
"Version: ". After an update from template every Heading 3 in the
document was prefixed with "Version: "!)

However, if you set the Style-List Template links up using VBA and named
List Templates (as opposed to references via the List Gallery objects),
the Style-List Template link is solid under update styles and also
copying and pasting text between documents. (But not necessarily under
copying Styles using the Organizer, I find.) There is information on
this in the archives of the microsoft.public.word.numbering group - Dave
Rado posted sample code a few months ago, and I've posted various bits
and pieces too.

Re some of your other points:

If you make changes to styles in a document, you can have them update
back into the template if you check the 'Update template' check box when
you OK the style modification. (Don't touch the 'Automatically update
style' box, which changes your style to follow any direct formatting you
apply).

To make sure that documents always update from their templates,
regardless of what the user might have fiddled with in the Tools-
Templates and Add-ins dialog, you could use an AutoOpen macro. However,
be careful about leaving documents automatically updating styles on
open. It can be very embarrassing if you send a document to a client who
happens to have a template with the same name you use - especially as
there is no way to 'undo' the update from the open document! Personally
I think it is safer to perform the update on demand, or (if you don't
trust your users) when they close the file (AutoClose macro), leaving
the Update Styles setting off.

Word has its own way of picking up templates which you should be able to
use to your advantage. When a document is opened, Word looks first in
the User Templates directory and then in the Workgroup Templates
directory (according to the locations set up under File Location
options). If it fails to find a template of the right name there, then
it will look in the same directory as the document, then try to follow
the original path, and finally look under Program Files (I think that's
the right order). So if you put your company templates on the network
and have everyone's Workgroup Templates location pointing at them, and
allow individual users to have local copies anywhere except in their
User Templates directory, then whenever they (or another user) open a
document created from a local copy while attached to the network it will
be the network version that is opened and used to update styles (sorry,
that's a bit longwinded, but I hope you can see how it works).

Hope this is some help

Margaret

In article <qfugnsgchg7soa3n3...@4ax.com>, Damien Barkan
<dami...@aol.com> writes

--

Margaret Aldis, Syntagma, e-mail Margare...@syntagma.co.uk

"Civilisation advances by extending the number of important
operations which we can perform without thinking about them.
Operations of thought are like cavalry charges in battle - they are
strictly limited in number, they require fresh horses, and must
only be made at decisive moments." A N Whitehead

Bob Dietz

unread,
Jul 21, 2000, 3:00:00 AM7/21/00
to Damien Barkan
Hi Damien,

You have misunderstood the purpose of "Automatically update" in the
"Modify Style" / "New Style" dialogs. By checking that box, you are
asking Word to re-define the style each and every time you apply
manual formatting to a paragraph with that style name.

Suppose you've checked "Automatically update" for "Heading 1"
If you select any paragraph in the "Heading 1" style and then
manually format the paragraph to be aligned centered, Word will
then re-define the "Heading 1" style to have alignment = centered.

This feature can be useful while you are designing a new template.
However, once you have finished designing, this feature should be
set to off for every sytle in the finshed template.

Regards,
Bob Dietz

John McGhie [MVP - Word]

unread,
Jul 23, 2000, 3:00:00 AM7/23/00
to

Hi Damien:

This gets extremely complicated. My comments are interspersed with yours.

In microsoft.public.word.docmanagement on Fri, 21 Jul 2000 09:57:14 -0700,
Damien Barkan <dami...@aol.com> wrote:

> >You *can* make Word automatically update the styles from the template to the
> >document. If you attach the template with the "Automatically update styles"
> >field enabled, it will update the styles from the template each time the
> >document is opened. However, if the document contains bullets or numbering,
> >you MUST NOT set this feature or it will break all the lists in the
> >document. Which means it is useless for real-world documents.
>
> I tried to confirm this (in Word 97 SR-2), and couldn't. After
> creating a document from a particular template, I checked
> "Automatically update document styles" and saved and closed the
> document. Then I went back to the template and made changes to some
> styles in the stylesheet (including one that was bulleted), saved it
> and closed.
>
> (By the way, I was surprised to see that the changes I made in the
> stylesheet did *not* affect paragraphs in the template, as they
> normally do in a document when changing the stylesheet in the
> document. Why's that?)

Because you did not check "Add to Template" when you changed the local copy
of the style (the one in the document...). You must check Add To Template,
or the changes will not be written back to the template.

> Then I opened the document again, and found that paragraphs in the
> document that used the styles I had changed in the template not only
> were not "broken" (though I'm not certain exactly what you meant by
> that), but did *not" reflect the changes I had made in the stylesheet.

They were indeed broken. As soon as you opened the document, they were
re-written back to the styles in the template. Had you changed the
numbering, it would have been trashed.



> Next, I thought perhaps this was because these paragraphs in the
> document originated in the template (i.e., the template had several
> pages of paragraphs in it).

No, it was not that. There are several kinds of entity passed between a
template and a document, and the rules for what is passed when get
hair-raisingly complex. In this case, we are thinking about three things:

1) The text. This is passed only once, at the creation of the new
document. After that, no text changes in the template are ever passed to
the document.

2) The style properties. These are passed to the document EVERY time it is
opened if Automatically Update Styles is set, or only when the document is
created, if it is not. They are passed from the document to the template
ONLY if Add to Template is checked when styles are changed.

3) The List Templates (the bullets numbering properties). These are passed
to the document when it is created. They are also passed each time the
document is open, ONLY if the numbering is defined as part of the style. If
so, they will be passed from the document to the template if Add to Template
is checked. If the numbering is *not* part of the style, the list templates
are never passed back to the template but they will be passed to the
document at creation.

> So I deleted (in the document) all the
> paragraphs, entered some new paragraphs and tagged them with styles,
> and saved and closed the document. Then I made changeds in the styles
> in the template, and saved and closed it. When I then opened the
> document, the paragraphs tageed with the styles I had changed in the
> stylesheet (bulleted paragraphs) *did* reflect the changes I had made
> in the template's stylesheet.
>
> So can you clarify just what you meant by "break" in "you MUST NOT set
> this feature or it will break all the lists in the document"? And are
> there certain conditions under which this happens and other conditions
> where it does not happen?

Yes. I am an experienced technical writer, but I pale at the thought of
trying to explain this clearly :-) Let's have a go...

There are all sorts of things stored in templates. In the following, I use
"numbering" to mean both bullets and numbering, because to Word 97 and
above, they are the same thing. A bulleted list is simply a numbered list
that does not increment...

1) When a document is created from a template, all styles, numbering
formats and text are copied to the new document. Other things remain in the
template, and will be copied to the document only if they are used.

2) The template is attached to the document by default on creation, but
Automatically Update Styles is set OFF by default.

3) If the user then changes styles in the document, nothing is written back
to the template.

a) If the styles were left at their defaults in the template, Automatically
Update will be a style property, and every style will be based on Normal
style.

b) If any formatting is changed while Automatically Update is set, the
change will automatically update the changed style through the whole
document. You will get all manner of unplanned changes to the styles, which
is why we warn against it.

c) If Normal style is changed while all styles are based on Normal, the
change will flow to all styles in the document, which is why we warn against
that too.

4) When the document is saved and closed, the changed styles are written
back to the document (only) and saved.

5) When the document is re-opened, the new styles are contained in the
document, and the template remains attached.

6) If a second document is created from the template, steps 1 and 2 occur.

7) If styles are changed in the second document, the changes are saved only
in the second document. Neither the template nor the first document pick up
any changes.

However: If after step 1, the user re-attaches the template with
"Automatically Update Styles" set to ON, new things begin to happen...

3) If the user changes some styles in the document, the changes are saved
only in the document.

4) When the new document is re-opened, all changes to the styles in the
document are wiped out and a new style sheet is imported from the template.

6) If a second document is created from the template, it will have the
exact same properties as the first document.

7) If styles are changed in the second document, the changes are saved back
to the document only. If the second document is re-opened, its styles are
overwritten back to the same as the styles in the template.

Now, let's have a look at the same scenario when the user remembers to check
"Add To Template" while changing a style.

1) The change will now be saved to the template when the document is saved.

2) If the styles still have Automatically Update as a property, anytime any
change is made to the formatting, the style itself will be updated.

3) If during this, there is one "planned" change made and "Add to Template"
is checked, all styles from the document that have been changed
(intentionally or otherwise) will be written back to the template when the
document is saved.

4) When the document is opened, no change will be apparent because the
styles in the document were already current with the styles in the template,
but the template styles will be re-written into the document again.

5) But in the second new document, all hell breaks loose: All the styles
that were changed in Document 1, which were added to the template when
document 1 was saved, will now be imported to document 2 when it is opened.
This can be exciting: all of a sudden your carefully laid-out tables no
longer fit on the page because the underlying style properties have changed.

6) Even greater entertainment is possible if there were multiple documents
all attached to the template, and all were open when the style changes were
made. As each document is closed, its styles update the template. Next
morning, when all the documents are re-opened, they will all have exactly
the same styles: but which ones? It really depends a bit upon who closed
their document last the night before :-)

Just to recap: So far we are dealing with five things that are mutually
interdependent:

1) Whether the template is attached with "Automatically Update Styles" set
ON or OFF.

2) Whether "Add to Template" was checked when any styles were changed in
the document.

3) Whether a given document was created before or after the styles were
changed.

4) Whether the styles in any given document retain the default
"Automatically Update" property.

5) Whether the styles in the document are based on Normal style still.

6) How many documents attached to the template remain attached and are
open, and when.

For example: If Document A is open and the user has updated a style with
"Add to Template", then you open Document B, update all the styles with "Add
to Template" then close it, then create Document C, then the other user
closes Document A, what do you think will happen? Right... Document C
picks up your new changes, Documents A and B and the template all revert to
the old styles except for the one changed by the user of Document A.

Now, if any of those users are using explicit saves while they work (and
anyone who DOESN'T save their document every time they pause hasn't been
using Word very long...) then, to quote a contingency-planning mate of mine,
we have a "Major HEV Experience" (HEV = High Entertainment Value). The
styles that exist in the template will vary from miniute to minute: what
ends up in Document C depends upon whether User A saved before or after
getting a coffee...

OK, that's the simple stuff out of the way, now let's introduce the
complexities.

1) A "style" can exist in one of three places: The document, the Attached
Template and one or more Global Templates. The same style can exist in all
three places, and can have completely different formatting in each place.
If the style is changed, the document always updates. The attached template
may do, depending on whether you set "Add to Template" at this change or any
previous one since the document was last saved. The Global template will
update only if the style does not exist in the Attached Template. If the
style exists in both places, the Attached Template picks up the change, the
global template does not.

2) So far we have made the naive if convenient assumption that all
formatting in the document is applied by styles. It never is. Some will be
applied as direct formatting. Bold and Italic almost always are: many
amatuer authors also "tweak" styled paragraphs to make things fit on a page:
this is direct formatting. Your first HEV Experience is that while the
style may update when the document is opened, any paragraphs changed with
direct formatting will not (or at least, the style properties will update,
but the change will not be apparent because the style formatting has been
overwritten). Whether direct formatting updates any styles depends on
whether Automatically Update is part of the style definition of the changed
paragraph. If it is, and paragraph properties were changed, the style
updates. If only font properties were changed, it depends whether the
paragraph mark was involved in the change: if it was, the font of the style
updates, otherwise no. Whether it gets written back depends on whether Add
to Template has been set since last save. Whether it flows to other
documents depends upon their settings for "Automatically Update Styles".
Note: It is entirely possible that a style may be changed in a document,
with "Add to Template" set, and written back to the template. This change
flows to all documents with templates set to "Automatically Update". If you
then discover the change was an error, your fix may not flow back to the
first document, because it may NOT have Automatically Update set.
Automatically Update Styles and Add to Styles are independent.

3) Numbering can exist in four places: The document, the templates
(attached and global) and the registry of the user who is logged on.
Whenever a user adjusts numbering in a document, their registry settings are
transferred to the document.

4) Numbering can also be applied three ways: As direct formatting, as part
of a style, or as field codes. If the numbering is part of a style, and the
template is attached with Automatically Update, that numbering will be
re-written every time the document opens. If a user alters numberring in
the document using direct formatting, that change will not be written to the
template, even if Add to Template is set. However, when the document is
re-opened, the numbering will now be broken. The overwrite coming in from
the template will update "some" lists in the document, but not the ones that
were changed by direct formatting.

5) Numbering which is not field codes can be applied from four sources:
From the style in the template; from the style in the document; from the
Format>Bullets and Numbering menu; or by AutoFormat As You Type. Only the
style in the template is updated by Add To Template, and whether it updates,
or corrupts, the style in the document depends upon the difference between
the numbering in the template and the numbering in the document, both direct
formatted and style-based.

6) The paragraph indent and tab properties can be stored in three places:
as direct paragraph formatting, as numbered list formatting, or as style
formatting. And of course, style formatting can be in three places, or four
if it is numbering...

There: that's the simplified version. The reality is quite a bit more
complex. Get back to us if there is anything you don't understand :-)

> Also (assuming I can use the conditions where it works properly), is
> there some way I can have all documents created from a particular
> template automatically default to "Automatically update document
> styles" checked instead of unchecked (to ensure that documents written
> by several writers in a team all have the same look, without calling
> their attention to the mechanics of doing this)?

No.

That is the reason I gave you the advice. If you set Automatically Update
Document Styles, you will re-write your styles from the template to the
document every time the document is opened. If your styles contain
numbering, Word will add list templates containing the template numbering to
the document each time it opens. Once this happens seven times, the list
templates involved are no longer visible to the user. If the document
user's computer sign-on differs from yours, all the list templates (there
are 21 in a standard set) will be re-written each time the document opens,
because each user's numbering settings are stored in the USER.DAT section of
their registry. In other words, even if the user uses the same computer you
did, if they have a different login, they will have different bullet and
numbering settings.

> - Is there some way I can get that checked checkbox to be grayed out
> so the user cannot uncheck it?

No, but you can embed a macro in the template that sets it on each time the
document is saved, even if they have tried to turn it off while they had it
open. So the next time the document is opened, the styles will again
update. And if they contain numbering, it will be broken.



> - Is there some way I can get a document created from a template on
> the user's local drive to be automatically attached not to that local
> template but to a template on a server (again, without the writer's
> intervention)?

Yes. All templates should be attached that way. In a professional writing
shop, the user's "Workgroup Templates" location on Tools>Options>File
locations should be set to a network share, and the templates there should
be customised for your workgroup.

When Word is installed, the default templates should NOT be installed on the
user's local drive, they should be installed and customised on the network
share. The sole exception is the user's Normal.dot, which MUST be on the
user's Network home drive, so that the user has exclusive read/write access
to it, and it gets backed up.

You should also enable UNC names (long net names) in the user's registries,
so that any template attached will be attached with a UNC name that includes
the server name. This enables documents to migrate around the network while
keeping their templates attached. For this reason, you need to ensure that
the Workgroup Templates share is accessible by any user in the company that
uses Word.

0 new messages