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!
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!