Modified styles/template and impact on new and old docs ?s

N

Norm

Trying to make sure that I understand the impact of revising both styles
and toolbars on newly created and old Word documents.

1. I create a "doc A" based on my Normal Template and save it. Close
that doc.

2. Then I make changes to my Normal Template: modifying some of the
styles used in doc A, creating some new styles and make some changes to
my custom toolbar.

3. I open doc A to make some changes.

I believe, but I'm not positive ;), that:

a) the style changes I made in step 2 will have not change the
previously created text in doc A

b) nor will they be in effect when I create new text in doc A. In other
words, my prior styles at the time doc A was first created will rule.

c) However, the custom toolbar will be available.

I'm not sure what will happen if I created a new style and placed it on
the custom toolbar.

Appreciate any input in confirming or correcting my understanding of
template and style changes.

Thanks.
 
J

John McGhie

Hi Norm:

Good! You are exactly correct in what you say. You are understanding one
of the most complex areas of Word use. Well done: this is a major
achievement. One of us should Linda!

When you start customising things, you need to wrap your mind around the
Word Document Object Model.

You must understand which objects are stored where in relation to the text
of the open document, and the customisation context in which you make the
changes. You will get to it over time: don't expect to understand it all
overnight.

Draw yourself a picture of nested squares:

The outside one is "The Internet." Inside that is "Your computer". Inside
that is "The Word Application." Now the fun begins:

Inside the Word application, show five boxes ...

* Across the top, the Normal Template and the Word Preferences

* On the next level, the Global Add-ins

* On the next level, The Attached template

* On the next level, The Open Document

(There is another collection of boxes in a hierarchy within the open
document, but we need not think about those for now.)

Now, for any "thing" that you need, "the system" (which is the collection of
all of the above) is going to look UPWARDS for what it wants, and take it
from the first place it finds it.

Now grab some colours. Let's use Red for Styles.

Draw a red list in the open document, the attached template, the global
add-ins, and the Normal template.

Styles can be in any of those.

The formatting properties of a given style can be different in each of those
places.

Word will use the first copy of the style that it comes to: it will grab the
first one it finds with the correct name.

Now, let's use Blue for toolbars. Draw a blue line in each of: The Open
Document, The Attached Template, The Global Add-ins, The Normal Template,
and The Word Application.

Same deal: you can choose to save a specified toolbar in any of those
locations. Word will use the first one it finds looking upwards. Word is
looking only at the toolbar name: a toolbar named "Formatting" may have
completely different commands in two locations; you (as the Customisation
Developer) are in charge of, and must control, which copy is going to be
used.

Now consider your scenario in the light of that:

* When you created Doc A, Word copied the Styles Table from your Normal
Template to Doc A: a snapshot, stored at the instant of creation.

* You then updated your Normal Template and your custom toolbar. You did
not specify to store the toolbars anywhere else, so Word stored them in your
Normal template.

* You then opened Doc A.

Word looked in its Preferences to see which toolbars should be visible and
went looking for them.

It first looked inside Doc A for toolbars, but there weren't any. You don't
have an Attached Template, or a Global Add-in. So Word kept looking up the
chain until it came to the Normal Template. There, it found your toolbar
and displayed it.

The changes you just made appeared, because there is only one copy of this
object in the system, and it is in the Normal template.

Now, you hit a button that calls one of the styles that you modified in the
Normal Template. What happens?

The answer depends on whether that style is currently in Doc A or not.
Since it was in Normal template before you created Doc A, it will be in Doc
A. And that's the version Word will use.

It will use the first copy of that style that it finds, looking up the
chain. The first one it comes to is the one in the document. Which did not
get customised. So you will use the old version in Doc A. If you now
create Doc B, it will have the new version of the style.

There's the answer to your question.

Now, for your next assignment...

If you create another template: Call it Template A, by copying your Normal
Template. Save Template A, then Open it, and make a change to
"NormsToolbar" in Template A (add a button). Make sure "Save in" is set to
"Template A" and Save.

Now, create a document by double-clicking Template A. You now have Document
A, no Attached Template, it's using Normal. And Document B, which is
attached to Template A.

Click between Document A and Document B.

When you click in Document B, your new toolbar button will appear.

When you click in Document A, it will go away again.

Because each time, Word is looking UP the chain for the toolbar it wants.

When you click in Document A, Word looks in the Preferences and discovers
that it needs the NormsToolbar toolbar. It looks for an Attached Template.
There isn't one. It looks in Normal, finds the NormsToolbar toolbar, and
displays it.

When you click in Document B, Word looks in the Preferences and discovers
that it needs the NormsToolbar toolbar. It looks for an Attached Template.
There is one. It looks in there, finds the NormsToolbar toolbar, and
displays that version, which has your latest change.

When you do this for a living, you spend a lot of time managing the "scope"
of changes so that customisations appear where they are supposed to, only
where they are supposed to, and not anywhere else.

Enjoy!

Trying to make sure that I understand the impact of revising both styles
and toolbars on newly created and old Word documents.

1. I create a "doc A" based on my Normal Template and save it. Close
that doc.

2. Then I make changes to my Normal Template: modifying some of the
styles used in doc A, creating some new styles and make some changes to
my custom toolbar.

3. I open doc A to make some changes.

I believe, but I'm not positive ;), that:

a) the style changes I made in step 2 will have not change the
previously created text in doc A

b) nor will they be in effect when I create new text in doc A. In other
words, my prior styles at the time doc A was first created will rule.

c) However, the custom toolbar will be available.

I'm not sure what will happen if I created a new style and placed it on
the custom toolbar.

Appreciate any input in confirming or correcting my understanding of
template and style changes.

Thanks.

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
N

Norm

John McGhie said:
Hi Norm:

Good! You are exactly correct in what you say. You are understanding one
of the most complex areas of Word use. Well done: this is a major
achievement. One of us should Linda!

Given it is a very rare occurrence that I'm able to remove the dunce
cap, your accolades have already been forwarded to her Mac. :)

Now, I'm getting prepared for her response..... it may well be something
like....... well it took you long enough to get it right and you imposed
on that nice Aussie waaaaay too much. ;)

And three cheers!
 
N

Norm

Thanks John:

John McGhie said:


Appears that I have a very, very long assignment.

I know what I'll do if I can't sleep tonight.

But first I must rest the miniscule grey matter.

Good night here and G'day there.
 
N

Norm

Hi John:

That class was very helpful, Professor McGhie. Thanks.

But........ of course ;) ......... a couple of f/u questions. I hope
I've proofed and re-proofed.


When you start customising things, you need to wrap your mind around the
Word Document Object Model.

I don't think I've read/heard of that term. Is there anything to read?

Draw yourself a picture of nested squares:

Where is my better half? My drawing is slightly worse than my spelling
and typing. :-(

But I did draw those pictures. :)

Now consider your scenario in the light of that:

* When you created Doc A, Word copied the Styles Table from your Normal
Template to Doc A: a snapshot, stored at the instant of creation.

Question 1: I thought, I guess erroneously, that Word attached the
current Normal Template to Doc A at the instant of creation. Now, from
what you say that is not so. ?

Question 2: In addition to the Styles Table, does Word copy a snapshot
of all toolbars? From what I know at this point, I would say "no."

* You then updated your Normal Template and your custom toolbar. You did
not specify to store the toolbars anywhere else, so Word stored them in your
Normal template.

* You then opened Doc A.

Word looked in its Preferences to see which toolbars should be visible and
went looking for them.

Question 3: Curious on this....
The Word Preferences gives the location of any user toolbars. Is that
what Word is looking for at this point?

It first looked inside Doc A for toolbars, but there weren't any.

Question 4: This is really the same question as #2 and from your
sentence directly above I now know that the toolbars are not part of
that snapshot at the time of creation......
The question/statement:
When I created Doc A, I did have a custom toolbar at that point in time.
I gather it is not "part" ( not sure correct term to use) of Doc A.

You don't
have an Attached Template, or a Global Add-in.

Question 5: This would appear to answer my Question 1?
So Word kept looking up the
chain until it came to the Normal Template. There, it found your toolbar
and displayed it.

The changes you just made appeared, because there is only one copy of this
object in the system, and it is in the Normal template.

Question 6: My prior custom toolbar is gone! Correct?
Now, you hit a button that calls one of the styles that you modified in the
Normal Template. What happens?

The answer depends on whether that style is currently in Doc A or not.
Since it was in Normal template before you created Doc A, it will be in Doc
A. And that's the version Word will use.

It will use the first copy of that style that it finds, looking up the
chain. The first one it comes to is the one in the document. Which did not
get customised. So you will use the old version in Doc A.

Question 7: If I used a new style rather than a modified one, it would
go up the chain and find it first, and only, in my Normal Template.
Correct?

Question 8: So, if I under correctly, depending on when a style was
created, Word might use styles from different sources when editing a
previously created doc?

If you now
create Doc B, it will have the new version of the style.

There's the answer to your question.

Thank you very much,

Norm


PS:
Now, for your next assignment...

But only after I digest this last assignment. ;)
 
J

John McGhie

Hi Norm:

I don't think I've read/heard of that term. Is there anything to read?

Yes, there is, but not in Word 2008. It's in the VBA Help, which you don't
have. However, we have been talking about it ever since you enrolled: you
are now at the stage where you are getting into "Advanced Customisation" so
I used the formal term. But whenever we have been talking about
"properties" and "inheritance" and "chaining" we have been talking about the
behaviour of the Word Document Object Model.
Question 1: I thought, I guess erroneously, that Word attached the
current Normal Template to Doc A at the instant of creation. Now, from
what you say that is not so. ?

The insides of Word are not 100% consistent. Better than many applications,
but not 100%. For our purposes, we can say "The Normal Template is
permanently attached."

Later, when we need to split the difference, we can say that "The Normal
Template is a global add-in, and as such, it is attached to the
"Application", not the "Document".

So if you look at your diagram of squares, the Normal template (and any
other global add-ins you may have, such as PDFMaker.dot...) are attached a
level above the document, in the Word Application.
Question 2: In addition to the Styles Table, does Word copy a snapshot
of all toolbars? From what I know at this point, I would say "no."

And you would be correct. Styles, List Styles, Table Styles and Text are
copied, nothing else is.
Question 3: Curious on this....
The Word Preferences gives the location of any user toolbars. Is that
what Word is looking for at this point?

Microsoft has been avoiding telling us what is in the preferences for 20
years. This year, I had yet another attempt to produce the information. It
met with the same success as always...

As near as we can tell, "one" of the preferences contains a "list of visible
toolbars". Just the names, not the locations. Word goes looking for them
after it opens the document and any attached template.
Question 4: This is really the same question as #2 and from your
sentence directly above I now know that the toolbars are not part of
that snapshot at the time of creation......
The question/statement:
When I created Doc A, I did have a custom toolbar at that point in time.
I gather it is not "part" ( not sure correct term to use) of Doc A.

Correct. Toolbars are not automatically copied from templates to documents.

You can force toolbars into documents, either by creating them and changing
"Save In", or by using Organiser to copy them in. I regard either as "poor
practice".

Generally, having "customisations" in DOCUMENTS will lead to trouble and
restrictions throughout the company's IT infrastructure. There are a
vanishingly rare set of circumstances where you might want to do this, and
an even rarer set where you might need to.

If you come across one, treat it as "god's suggestion to you" that you are
going about the project the wrong way. Step back, and ask yourself what's
wrong with your approach.

If you don't want to do all that thinking, treat this as a RULE: "Don't put
toolbars or macros in documents!" :)
Question 5: This would appear to answer my Question 1?

You go ask Linda if there is just the teensiest possibility that you may
have begun asking questions before reading the entire post :)
Question 6: My prior custom toolbar is gone! Correct?

The index to the Toolbars Collection is the "Name" of the toolbar. Unless
you saved the toolbar with a different name, you over-wrote it when you
changed it.
Question 7: If I used a new style rather than a modified one, it would
go up the chain and find it first, and only, in my Normal Template.
Correct?

It makes no difference at all. The Index to the Styles collection is the
style "Name". Whether you created it fresh, or customised a built-in, or
customised an existing style is irrelevant. Word will look up the chain of
objects: looking first in the document, then the attached template, then the
global add-ins, then the Normal template, etc...

If it's looking for "Body Text" it will use the first one it finds in the
chain. If it's looking for "Norm's Style", same thing.

If you created a new style in the open document, Word doesn't have to look
any further, the style is in the document. If you also added that style to
the template while you were creating it, Word still uses the copy in the
document, because that's the closest one.
Question 8: So, if I under correctly, depending on when a style was
created, Word might use styles from different sources when editing a
previously created doc?

When editing a document, Word will use only the styles applied to the text
of that document. Those styles must be in the document, otherwise they
couldn't be applied to the text.

Later, when you place buttons on toolbars to apply named styles, you will
force Word to go looking for the styles.

If you have a button that applies "Norm's Style" and "Norm's Style" has
previously been used in the document, Word will use the local copy. If the
style has not previously been used in the document, Word will go trudging up
the inheritance chain looking for it, and use the first copy it finds.

Let's assume Norm's Style was previously used in the document. You set the
font to Red to mark some text, and applied it. Later you deleted all that
text, so there is no text in the document now formatted with Norm's Style.

In the Attached Template, after creating the open document, you added
"Norm's Style" but in the Attached Template the font is green. In the
Normal Template, there has "always" been a "Norm's Style", but its font is
blue.

If you click your "Norm's Style" button in the open document, you will get
red. Even though there is no text in the document with Norm's Style, the
style remained in the Style Table and its font is red.

If you create a new blank document and click the button, you will get Blue,
because in Normal Template, Norm's Style is blue.

If you create a new document from the Attached Template and click the
button, you'll get green, because the Attached Template is closer than the
Normal Template.
But only after I digest this last assignment. ;)

Go and have a postprandial Guinness, it aids the digestion...

Cheers

This email is my business email -- Please do not email me about forum
matters unless you intend to pay!
 
N

Norm

Hi John:

Thanks much for all the info in your last post. Very helpful!


You go ask Linda if there is just the teensiest possibility that you may
have begun asking questions before reading the entire post :)

It certainly reads like that was the case. Possible. ;)

But actually, when I proofed before posting, I decided to leave it in
because it asked the question in a slightly different way.

And while yours (see above) said I didn't have an Attached Template
given that example I gave in my post, I remember, or think I do, you
saying in one of your introductory classes oh so many months ago that
when one creates a doc the Normal Template is attached. I was lazy, I
admit it, and did not search back the 3 or 4 months to find your post
and the exact wording.

So, bottom line, I left Question 5 and 1 in to make sure I understood
the attached template concept. I apologize for asking the prof to
confirm for the hard of hearing. ;)

Go and have a postprandial Guinness, it aids the digestion...

Great suggestion!!!!!!!!!

Thanks for the help,

Norm
 
N

Norm

Hi John:

John McGhie said:
When you do this for a living, you spend a lot of time managing the "scope"
of changes so that customisations appear where they are supposed to, only
where they are supposed to, and not anywhere else.

Do you find you have to slow down to make sure the scope is correct or
is it second nature by now? I would and I might still goof. ;)

I did.

Thanks for imparting more Word info,

Norm
 
J

John McGhie

Hi Norm:

when one creates a doc the Normal Template is attached.

The term Attached Template can be either a noun or an adjective. The key
concept is what it is attached "to".

If we refer to "The" Attached Template, we are referring to the template
attached to a document, usually at the instant of creation.

If we refer to "Attached Templates", we mean the templates that may or may
not be attached to documents when they are open. You can think of these as
"ordinary templates".

There are also "Global Add-Ins". These are templates that are attached to
the Word Application, not to any particular document. They are usually
loaded by Word from the Startup Folder at application launch. They are
connected into the Document Object Model a level above the open documents,
in the Word Application. And there can be more than one of them.

The Normal Template is a special case of Global Add-in. It is connected
"above" the Global Add-ins. Normal is the first one loaded on Application
Launch, it is always loaded, and can be considered part of the Word
application. Sometimes, it *is* part of the Word application: there are
cases where Normal does not exist as a file, it is simply a collection of
default properties within the application code.

My point is that if you have a piece of code that is looking amongst the
"attached templates" it will not see the Normal Template. If your code asks
for the attached template for a document, Word will never hand it a pointer
to Normal Template: if there is no attached template, Word will simply
return "Empty". If you want the Normal template, you have to ask for it
explicitly.

So while the Normal Template is always there, and always "connected to
Word", it is never "attached to a document".

Because of the importance of the inheritance hierarchy, you have to keep
this set of "ranks" or "levels" clear in your mind when customising, because
you must ensure that your customisations are stored in the correct level to
ensure they are available when you need them and not when they shouldn't be.

Cheers

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
J

John McGhie

Hi Norm:

Do you find you have to slow down to make sure the scope is correct or
is it second nature by now? I would and I might still goof. ;)

Well, I screw it up from time to time like everyone else. When you get it
wrong, it usually creates inexplicable weirdnesses in the behaviour of the
application, and can be very difficult to diagnose.

When I am doing a commercial project, I carefully check that I have got this
right, because if it's wrong when it gets to the customer, they normally are
unable to fix it.

Cheers

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 
N

Norm

Hi John:


John McGhie said:
So while the Normal Template is always there, and always "connected to
Word", it is never "attached to a document".

Ah.... that helps and I was missing that concept.
Because of the importance of the inheritance hierarchy, you have to keep
this set of "ranks" or "levels" clear in your mind when customising, because
you must ensure that your customisations are stored in the correct level to
ensure they are available when you need them and not when they shouldn't be.

Hmmmm..... that means challenging the memory. Have a "app for that"?

Thanks,

Norm
 
J

John McGhie

Hi Norm:

Hmmmm..... that means challenging the memory. Have a "app for that"?

Yeah. Ask me again when you begin to sell commercial customisation
solutions in Word 2011.

Until then, use "Linda". Works well, and runs all day on cups of tea...

Cheers

--

The email below is my business email -- Please do not email me about forum
matters unless I ask you to; or unless you intend to pay!

John McGhie, Microsoft MVP (Word, Mac Word), Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. | Ph: +61 (0)4 1209 1410 | mailto:[email protected]
 

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