Bullets & numbering messed up. "Update" macro at fault?

B

Barbara

I am maintaining a template for myself and others in Word 2003. Recently I
began to see some odd behavior when I open documents created before some time
in January: namely, bulleted and numbered styles are redefining themselves.
For example, every bulleted item (which is actually "outline numbered") has
become sequentially numbered with a left indent of 0, regardless of its
outline level. The numbered items have become bulleted. (There is some
variation in what happens, but this is a typical scenario.)

New documents are fine. If I create a new document based on this template
and paste everything from the old document into it, everything is fine. Maybe
I should be happy with this not-too-difficult remedy. But it just doesn't
seem right, and I worry that I am heading for trouble.

Also, manually asking to update styles from the template seems to do nothing
at all to the older documents (i.e., those that are more than a month or so
old).

I suspect that some recently added macros are the problem, based mostly on
the timing of the symptoms.

The recently added macros come from the MVP article, "How to safely update a
document's styles from its template without using the Organizer (and how to
make the Tools + Templates and Add-ins dialog safe)" at
http://word.mvps.org/faqs/macrosvba/UpdateStyles.htm.

Here's what I have done, following (I think) the advice in that article:
1. AutoNew() has one line: CommandBars("Hidden").Enabled = False.
2. AutoOpen() has the code found at the beginning of "Gotcha" 3. My
intention is to update styles from the template whenever the user opens a
doc. AutoOpen also has CommandBars("Hidden").Enabled = False.
3. AutoClose() has one line: ActiveDocument.UpdateStylesOnOpen = False.
4. ReplacementToolsTemplatesAndAddins() has the code found under "Gotcha"
3a. I also did all the rest of the steps described there (3b through 3e).

I changed nothing in the code from the article.

Here's what I want in the documents.

I have defined List Bullet 1 through List Bullet 5 as per Shauna Kelly's
instructions (http://www.shaunakelly.com/word/bullets/controlbullets.html).
These styles are associated with the list template (ListNum field) that I
named Bullets and are outline-numbered.

I have one other numbered style, named Note. That style uses simple
numbering, customized with a number format of "Note:" (in orange and bold)
and a number style of (None). The effect is that a paragraph tagged as Note
automatically gets "Note:" and the appropriate hanging indent, without any
actual numbers. As far as I can tell, I have no ability to associate a
specific, named list template with this style.

(We do have numbered steps and lettered sub-steps in the documents. But I
have created a few macros to number them using SEQ fields rather than using
Word's autonumbering. The macros are not very ambitious but produce very
reliable sequential numbers and letters.)

Perhaps it is relevant that many of the older documents have "Update styles
from template" switched on.

Any idea what might be going wrong here? Did I follow the directions wrong?
Does the code in the article have any problems? Is this strategy of pasting
the contents of each document into a new document really the best option for
getting the bullets and notes back to their intended formats? (I sort of hate
to do that, until I have some truly substantial edits for the older docs. An
entry in the revision history of "Re-saved because something went wrong in
the template" seems bad. But the docs now look weird whenever we open them.)

Thanks for taking the time to read this long and complicated question!
 
S

Shauna Kelly

Hi Barbara

1. Use File > Open to open the template. And apply every style in the
template at least once. In the Styles & Formatting pane, when you choose
to show 'Styles in Use' you need it to list every style in the template.

2. >My intention is to update styles from the template whenever the
user opens a doc.
In the military, you'd get a bravery award for that! Do you really need
to update them every time the user opens a document? Word really isn't
very good at doing this.

Shauna

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
T

Tony Strazzeri

I am maintaining a template for myself and others in Word 2003. Recently I
began to see some odd behavior when I open documents created before some time
in January: namely, bulleted and numbered styles are redefining themselves.
For example, every bulleted item (which is actually "outline numbered") has
become sequentially numbered with a left indent of 0, regardless of its
outline level. The numbered items have become bulleted. (There is some
variation in what happens, but this is a typical scenario.)

New documents are fine. If I create a new document based on this template
and paste everything from the old document into it, everything is fine. Maybe
I should be happy with this not-too-difficult remedy. But it just doesn't
seem right, and I worry that I am heading for trouble.

Also, manually asking to update styles from the template seems to do nothing
at all to the older documents (i.e., those that are more than a month or so
old).

I suspect that some recently added macros are the problem, based mostly on
the timing of the symptoms.

The recently added macros come from the MVP article, "How to safely update a
document's styles from its template without using the Organizer (and how to
make the Tools + Templates and Add-ins dialog safe)" athttp://word.mvps.org/faqs/macrosvba/UpdateStyles.htm.

Here's what I have done, following (I think) the advice in that article:
1. AutoNew() has one line: CommandBars("Hidden").Enabled = False.
2. AutoOpen() has the code found at the beginning of "Gotcha" 3. My
intention is to update styles from the template whenever the user opens a
doc. AutoOpen also has CommandBars("Hidden").Enabled = False.
3. AutoClose() has one line: ActiveDocument.UpdateStylesOnOpen = False.
4. ReplacementToolsTemplatesAndAddins() has the code found under "Gotcha"
3a. I also did all the rest of the steps described there (3b through 3e).

I changed nothing in the code from the article.

Here's what I want in the documents.

I have defined List Bullet 1 through List Bullet 5 as per Shauna Kelly's
instructions (http://www.shaunakelly.com/word/bullets/controlbullets.html).
These styles are associated with the list template (ListNum field) that I
named Bullets and are outline-numbered.

I have one other numbered style, named Note. That style uses simple
numbering, customized with a number format of "Note:" (in orange and bold)
and a number style of (None). The effect is that a paragraph tagged as Note
automatically gets "Note:" and the appropriate hanging indent, without any
actual numbers. As far as I can tell, I have no ability to associate a
specific, named list template with this style.

(We do have numbered steps and lettered sub-steps in the documents. But I
have created a few macros to number them using SEQ fields rather than using
Word's autonumbering. The macros are not very ambitious but produce very
reliable sequential numbers and letters.)

Perhaps it is relevant that many of the older documents have "Update styles
from template" switched on.

Any idea what might be going wrong here? Did I follow the directions wrong?
Does the code in the article have any problems? Is this strategy of pasting
the contents of each document into a new document really the best option for
getting the bullets and notes back to their intended formats? (I sort of hate
to do that, until I have some truly substantial edits for the older docs. An
entry in the revision history of "Re-saved because something went wrong in
the template" seems bad. But the docs now look weird whenever we open them.)

Thanks for taking the time to read this long and complicated question!

Barbara,

Do the documents appear differently on different computers?

I recall that the list styles/number styles settings are not template
specific, rather oddly they are workstation specific. This may be the
cause of your problem.

To test this open a document on two different pcs on one of which you
change the numbering/list style. If the look changes on that PC this
will be why.

To overcome this problem in a large corporate environment I created a
Autoexec macro that resets the number/list styles to a standard format
every time word starts.


Hope this helps.

Cheers
TonyS.
 
S

Shauna Kelly

Tony Strazzeri said:
Barbara,

Do the documents appear differently on different computers?

I recall that the list styles/number styles settings are not template
specific, rather oddly they are workstation specific. This may be the
cause of your problem.

To test this open a document on two different pcs on one of which you
change the numbering/list style. If the look changes on that PC this
will be why.

To overcome this problem in a large corporate environment I created a
Autoexec macro that resets the number/list styles to a standard format
every time word starts.


Hope this helps.

Cheers
TonyS.


Hi Tony
I recall that the list styles/number styles settings are not template
specific, rather oddly they are workstation specific.

I think you're thinking of the List Galleries.

In the user interface, they are exposed in the Bullets and Numbering
dialog (which you can see from Format > Bullets and Numbering). In that
dialog, each white 'pane' represents a List Gallery.

In the object model, they are exposed at Application.ListGalleries (ie
the Application level, not at the document or template level).

In real life, they are in the registry at
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\List Gallery
Presets. So they are user-specific and machine-specific (because they're
in HKCU).

The danger that prompts mention of these wretched little things is that
Macro Recorder uses ListGalleries if you record applying bullets or
numbers to text. While the Macro Recorder is a great tool, and none of
us could live without it, it sometimes leads us to the wrong path. By
using the ListGalleries in its code, the Macro Recorder is creating code
that effectively says "apply the format in the 3rd white pane on the
second row". Since the ListGalleries are user- and machine-specific, and
change over time, code that applies the format of the 3rd pane on the
second row isn't very useful!
To test this open a document on two different pcs on one of which you
change the numbering/list style. If the look changes on that PC this
will be why.

If the look changes, it can be due to two things.

(1) Minor points of pagination, such as one more or one fewer line on a
page, may be caused by different printer drivers.

(2) Changes in formatting will only occur if
(a) the box at Tools > Templates and Add-ins > Automatically Update
Document Styles is ticked *and*
(b) the reader has a template of the same name as the one to which the
document is attached, *and*
(c) the reader's template has styles of the same name formatted
differently from the author's template.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
B

Barbara

Shauna,

Thanks for the suggestions. (Thanks also for the instructions you have
posted at your web site about bullets and numbering!)

1. I applied all the styles before adding my new macros. And I have now done
it (or tried to do it) again. My dropdown list offers only the following
options: Available formatting, Formatting in use, Available styles, All
styles, and Custom. As per the instructions in "How to safely update...," I
opened the template and applied each style in the template to a paragraph.
This means that every style has been used in the template itself. But that
wasn't enough to get these styles to appear in any list (except for All
styles) The only way to get every style to appear in the list of Available
styles (which seems the closest I have to Styles in use) is to include a
paragraph of each style in the template. So I added a bunch of useless
paragraphs to the template, for the sole purpose of making sure they all
appear in that list.

This was not, however, enough. The bullets and notes (my only "numbered"
style) are still wrong in the older docs.

Any other ideas? (Might it be time to reinstall Word?)

2. Well, I don't really need to update styles from the template every time a
user opens a document. I only need to do this the first time a document is
opened after I have changed a style in the template. But I don't know how to
tell when that happens. Do you have any suggestions?

Thanks for your help!
Barbara Hill
 
B

Barbara

Tony and Shauna,

Well, for whatever it is worth, I have at least one case where two different
copies of the document look different from each other on my own computer.

One copy of the document is in an eRoom, a sort of a fancy network share.
When I open the document directly from there, it looks fine.

I copied that document to my desktop. When I open that copy, the bullets and
numbers are wrong.

Tony, what exactly do you mean when say that you "created a
Autoexec macro that resets the number/list styles to a standard format
every time word starts" ?

Thanks!
Barbara Hill
 
B

Barbara

Whoops, I take it back. The copy from the eRoom is not exactly "fine." Its
bullets and numbering are fine. But it also has some older style definitions
that did not automatically update themselves. And when I update via Tools >
Templates & Addins, the "obsolete" styles change, but the bullets and
numbering also get messed up.

So I guess that the AutoOpen() macro either did not run or did not do its
job when I opened the doc from the eRoonm.
 

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