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

ListNumbering Street, Revisited

55 views
Skip to first unread message

Klaus Linke

unread,
Jul 28, 2001, 3:00:32 AM7/28/01
to
I finally got around to reading the thread

Nightmare on ListNumbering Street
http://groups.google.com/groups?hl=en&th=9e790fa7ed2886b3,18&ic=1

Frankly, I don't understand the problems everybody has with numbering.
As long as the numbering is done by styles, I don't recall any problems.
If I get documents that have not been done using styles, I remove all
numbering and bullets, check if all list templates have been removed, then
define the numbering in the styles.

Since I only use numbering every other year (I do dictionaries, not legal
documents), maybe I have just been lucky not to run into the problems.

Until now, I have not used named list templates; but it seems a very good idea.

Defining named list templates doesn't require VBA, as far as I can see;
you just type in the name in the bottom left of the dialog "Format >
Bullets and Numbering > Outline Lists > Modify" when you define it.

Restarting the numbering doesn't seem to require any tricks either,
the two toggle buttons in the "Bullets and Numbering" dialog
(o Restart numbering / o Continue list) work well. They *do* use the
list galleries, so recording clicking those buttons, trimming, and
replacing the ListGallery references with the named List Template, I get:

Dim myLT As ListTemplate
Set myLT = ActiveDocument.ListTemplates("myList")
Selection.Range.ListFormat.ApplyListTemplate _
ListTemplate:=myLT, _
ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList, _
DefaultListBehavior:=wdWord9ListBehavior

to start renumbering, and if you want to re-join the lists, you'd use
... ContinuePreviousList:=True, _

(Praise to the macro recorder; I would have tried any parameter but "wdListApplyToWholeList"!)

This does not produce new List Templates. Since spaghetti numbering is caused
by different list templates getting intertwined I can't see that just
restarting might cause problems, or be considered harmful manual formatting.

Since you probably want to remove the dialog anyhow to protect innocent users
from wreaking havoc, you could use toolbar buttons for restarting/joining
lists. With a bit of sweat, you could perhaps come up with *one* toggle button
to do both actions (though I don't see how at the moment).

You could also put in a hidden field { LISTNUM "myList" \s0 } to restart
numbering (in an extra, hidden paragraph), and delete it when you want the
list to continue, but that is a bit clunky.

Sometimes it's convenient to have your list numbering re-start automatically
in each (sub-)chapter; you can achieve that (as long as your heading styles
are *not* numbered) by including your heading style at the top of the outline
list template (without numbering/indent). (That seems to be the way numbering
is recommended to be applied generally, as far as I understood the other
threads: putting a "dummy" style at the top to restart numbering)

It would have been nice if you had the choice to restart numbering every time
a paragraph without numbering is inserted. As far as I can see, somebody at
Microsoft ruined that by interpreting ".ResetOnHigher=0" to mean
".ResetOnHigher=False" instead of interpreting "0" as the numbering level.

I'm sorry if some of this already came up in earlier discussions, I didn't
read them all. Perhaps I somehow missed the point :-/

Greetings, Klaus

Dave Rado

unread,
Jul 28, 2001, 8:15:21 AM7/28/01
to
Hi Klaus

| Frankly, I don't understand the problems everybody has with numbering.
| As long as the numbering is done by styles, I don't recall any problems.

You've been lucky! <g>


| If I get documents that have not been done using styles, I remove all
| numbering and bullets, check if all list templates have been removed

You *cannot* remove list templates from a document, unfortunately, unless
you paste into another document. The best you can so is reset all the
options on the FB&N dialog, but MsgBox ActiveDocument.ListTemplates.Count
returns the same number before and after doing so.

If you paste your text into a new List Template-less document, that will get
rid of most of the redundant ones; and if you paste it as unformatted text
into a new List Template-less document, that will get rid of all of them.


| Since I only use numbering every other year (I do dictionaries, not legal
| documents), maybe I have just been lucky not to run into the problems.

How many users use your templates? How much copying and pasting
between documents do they have to do? Do they ever update styles from
template? Do they ever copy styles using the Organizer? If "none"/"no", I
suspect that's why you haven't seen the problems.


| Until now, I have not used named list templates; but it seems a very good
idea.
|
| Defining named list templates doesn't require VBA, as far as I can see;
| you just type in the name in the bottom left of the dialog "Format >
| Bullets and Numbering > Outline Lists > Modify" when you define it.

Yes but the styles are not nearly as solid when defined that way as when
defined using VBA, in my experience.


| Restarting the numbering doesn't seem to require any tricks either,
| the two toggle buttons in the "Bullets and Numbering" dialog
| (o Restart numbering / o Continue list) work well. They *do* use the
| list galleries, so recording clicking those buttons, trimming, and
| replacing the ListGallery references with the named List Template, I get:
|
| Dim myLT As ListTemplate
| Set myLT = ActiveDocument.ListTemplates("myList")
| Selection.Range.ListFormat.ApplyListTemplate _
| ListTemplate:=myLT, _
| ContinuePreviousList:=False, _
| ApplyTo:=wdListApplyToWholeList, _
| DefaultListBehavior:=wdWord9ListBehavior

Try running:
MsgBox Selection.Range.ListFormat.ListTemplate.Name

before and after running that code. (It returns nothing afterwards).


| (Praise to the macro recorder; I would have tried any parameter but
"wdListApplyToWholeList"!)

I agree - I couldn't live without it - although the problem with it is that
you need to know what you're doing when you use it - the recorded code
always has to be rewritten. But it's a great shortcut for getting the
syntax for things.


| This does not produce new List Templates.

No, it just screws up the existing ones.


| Since spaghetti numbering is caused
| by different list templates getting intertwined I can't see that just
| restarting might cause problems, or be considered harmful manual
| formatting.

I just created a [document] template in which I defined the List Number
styles your way; created a new document based on it, created a list in it,
restarted the numbering using your code, and pasted the resulting list into
another document based on the same template, and:
1.
2.
3
magically turned into
1.
4.
5..

Once the restart code removes the name from the list template, you're in
trouble if you paste the list to other documents.

I imagine it also makes it prone to the "numbering sometimes changes when
the same document is opened on a different machine" bug as well, although
that bug is impossible to reproduce "on demand", so I can't test for it.

And if you ever need to press Ctrl+Q, of course, it will remove the restart;
and sometimes even updating styles from template removes the restart
(although I can't reproduce that "on demand", but I've seen it happen).


| Since you probably want to remove the dialog anyhow to protect innocent
users
| from wreaking havoc, you could use toolbar buttons for restarting/joining
| lists.

I do, though I'm a strong believer in the "dummy style" method of
restarting, and my buttons use that method. Quite apart from the bugs,
something as important as where a list restarts shouldn't be determined by
manual formatting IMO.


| With a bit of sweat, you could perhaps come up with *one* toggle button
| to do both actions (though I don't see how at the moment).

My numbering button applies restart by default, and I have a button (also a
keyboard shortcut) to remove the restart. To reapply the restart, you can
just click on my numbering button again. So I *sort of* have two buttons,
but one of them is a hybrid.


| You could also put in a hidden field { LISTNUM "myList" \s0 } to restart
| numbering (in an extra, hidden paragraph), and delete it when you want the
| list to continue, but that is a bit clunky.

I prefer using a dummy style.


| Sometimes it's convenient to have your list numbering re-start
automatically
| in each (sub-)chapter; you can achieve that (as long as your heading
styles
| are *not* numbered) by including your heading style at the top of the
outline
| list template (without numbering/indent). (That seems to be the way
numbering
| is recommended to be applied generally, as far as I understood the other
| threads: putting a "dummy" style at the top to restart numbering)

In the types of document I work with, most non-heading list numbering
restarts far more frequently than that.

That's my tuppence - I hope John McGhie, Bill Coan, John Nurick and some of
the others who've been bitten will be along soon, as I'm sure some of them
could clarify some of your points better than I did, and they could
certainly provide a fuller perspective, between them.

Regards

Dave

Klaus Linke

unread,
Jul 29, 2001, 1:24:07 AM7/29/01
to
Hi Dave

Thank you for your detailed reply!


> You've been lucky! <g>

I know! And I'm already a bit sorry I opened that Pandora's box wilfully.
Shouldn't push my luck.


> | If I get documents that have not been done using styles, I remove all
> | numbering and bullets, check if all list templates have been removed
>
> You *cannot* remove list templates from a document, unfortunately, unless
> you paste into another document.

You even have to leave out the final paragraph mark -- which proves that
numbering as it's usually applied is a form of document corruption ;-)


> [...] and if you paste it as unformatted text into a new

> List Template-less document, that will get rid of all of them.

I wouldn't got THAT far (usually)


> How many users use your templates? How much copying and pasting
> between documents do they have to do? Do they ever update styles from
> template? Do they ever copy styles using the Organizer? If "none"/"no", I
> suspect that's why you haven't seen the problems.

They usually don't copy/paste between different documents, or if they do,
those are based on the same template (or don't contain numbering anyhow), so
yes ... I know I'm lucky.


> | Defining named list templates doesn't require VBA, as far as I can see;
> | you just type in the name in the bottom left of the dialog "Format >
> | Bullets and Numbering > Outline Lists > Modify" when you define it.
>
> Yes but the styles are not nearly as solid when defined that way as when
> defined using VBA, in my experience.

The code I saw in the posts looked like what you get from the macro recorder
... I'm not trying to contradict you, I just think it's easier to get it right
with the given interface than in VBA (at least for mortals like me)


> | Restarting the numbering doesn't seem to require any tricks either,
> | the two toggle buttons in the "Bullets and Numbering" dialog
> | (o Restart numbering / o Continue list) work well. They *do* use the
> | list galleries, so recording clicking those buttons, trimming, and
> | replacing the ListGallery references with the named List Template, I get:
> |
> | Dim myLT As ListTemplate
> | Set myLT = ActiveDocument.ListTemplates("myList")
> | Selection.Range.ListFormat.ApplyListTemplate _
> | ListTemplate:=myLT, _
> | ContinuePreviousList:=False, _
> | ApplyTo:=wdListApplyToWholeList, _
> | DefaultListBehavior:=wdWord9ListBehavior
>
> Try running:
> MsgBox Selection.Range.ListFormat.ListTemplate.Name
>
> before and after running that code. (It returns nothing afterwards).

Not here ... I always get "myList"; but I'll keep trying to reproduce that error.


> I just created a [document] template in which I defined the List Number
> styles your way; created a new document based on it, created a list in it,
> restarted the numbering using your code, and pasted the resulting list into
> another document based on the same template, and:
> 1.
> 2.
> 3
> magically turned into
> 1.
> 4.
> 5..

Not here, either, even if the new document is based on another template (both
parts of the list still show the list template "myList"). If I only copy part
of a list, the numbering starts at "1", but that is expected (if I want to
keep the numbers as in the original document -- for example to cite some law
--, I'd use "paste as unformatted text anyhow, to "chisel the numbering in
stone", as we'd say in Germany).

Again, I'll try to reproduce the error.


> And if you ever need to press Ctrl+Q, of course, it will remove the restart;
> and sometimes even updating styles from template removes the restart
> (although I can't reproduce that "on demand", but I've seen it happen).

That is a good point ... so restarting the numbering must be viewed as "manual
formatting" in this sense.


> | Since you probably want to remove the dialog anyhow to protect innocent
> | users from wreaking havoc, you could use toolbar buttons for
> | restarting/joining lists.
>
> I do, though I'm a strong believer in the "dummy style" method of
> restarting, and my buttons use that method. Quite apart from the bugs,
> something as important as where a list restarts shouldn't be determined by
> manual formatting IMO.

I agree. As long as it's not clear that my method works reliably, I'd stay
with something well tested.

> | You could also put in a hidden field { LISTNUM "myList" \s0 } to restart
> | numbering (in an extra, hidden paragraph), and delete it when you want the
> | list to continue, but that is a bit clunky.
>
> I prefer using a dummy style.

I don't now much about "LISTNUM" and "SEQ" fields, but it's nice you can
change the numering in lists based on a named template using fields (instead
of fudging with your list templates) -- for example you could start numbering
with "7" in a document by putting { SEQ "myList" \r7 } at the top. People that
*want* spaghetti still can get it ;-)


> | Sometimes it's convenient to have your list numbering re-start

> | automatically in each (sub-)chapter[...]


>
> In the types of document I work with, most non-heading list numbering
> restarts far more frequently than that.

It would be nice if there was a way to re-start numbering at a given
heading-level, the same way you can re-start after a given list level (again
something for mswish ... or is that included in Wd2002 already?)


> That's my tuppence - I hope John McGhie, Bill Coan, John Nurick and some of
> the others who've been bitten will be along soon, as I'm sure some of them
> could clarify some of your points better than I did, and they could
> certainly provide a fuller perspective, between them.

I'm still interested in the way the indent/outdent-buttons change the style
when working on outline-numbered/bulletted styles (they do
Selection.Range.ListFormat.ListIndent instead of Selection.Paragraphs.Indent
in these cases ... I wonder if that changes the style reliably?)

Thanks again, Klaus

Klaus Linke

unread,
Jul 29, 2001, 4:52:21 AM7/29/01
to
I could not reproduce your bug, but ran into another:

If I put in several restarts, I always end up with two lists (one from the
beginning of the file up to the first restart, one for the rest of the file).
If I copy a selection with more than one restart into another file, I loose
every restart but the first (I should have checked this earlier).

There *should* be some way to split a list into two lists. But unless I find a
way to do it reliably, I withdraw my suggestion.

Greetings, Klaus

Klaus Linke

unread,
Jul 29, 2001, 1:54:05 PM7/29/01
to
I feel pretty stupid for having started this thread; some research showed many
others have tried what I tried. Still, I'd like to report what I found, since
the things I found sometimes seem to contradict what others found. I hope John
McGhie, Margaret Aldis and others will point out errors ;-)

To start with, John says in his article "Word's numbering explained" at
http://www.mvps.org/word that Lists have a definition, a beginning, one or
more items, and an end. That makes sense, but is not so in Word97 and above.
Here, the definition of a list consists of two tables: a "list table" and a
"list override table". The list itself has *no* beginning and *no* end, only re-starts.

The "list table" contains the list definition (including the template for
outline lists), the "list override table" contains a list of start-at- and
formatting-overrides. I will only consider the start-at-overrides in the following.

Let's take a simple document containing one list (normal or outline-numbered).
The list table and template will contain the style(s) used in the list; so
every time one of that styles is encountered, Word will put in the right
numbering. Say, the table looks like this:
1. Paragraph A
2. Paragraph B
1. Paragraph C
2. Paragraph D
Paragraph E
3. Paragraph F

(The document contains only 6 paragraphs, of which all but E are formatted in
the numbered style)

If the document is formatted *very* conscientiously (using styles, and using
only restarts to change the numbering), it will look like this:

Then the override table will contain two re-start entries:
one for paragraph A (start the list with "1")
one for paragraphs C and F (restart the list with "1", continue the numbering
started at C)

If the numbering is done with styles, paragraphs A, B, C, D, F will contain
references to the style, paragraph A will contain a reference to the first
entry in the override table, and paragraphs C and F will contain a reference
to the second entry in the override table.

That is a very economic way to mark up tables: instead of having two lists
with start/end, plus 5 items = 9 "tags", you only have the style references
(which are there anyhow) plus 3 entries in the override table.

Though this implementation of lists might look elegant at first sight, it has
a terrible drawback: to get the numbering right, Word has to start counting at
the beginning of the file, and re-start every time it hits a reference to the
override table.

That works fine as long as you don't edit the file, and the people who
designed this format seem to have expected nobody ever would be so crazy and
copy/paste/insert/re-number or generally change anything.

If you *do* dare to edit, you'd probably have to wait quite a while, if Word
would even *try* to update the override table. So most times it doesn't try.
It only does it right when you start re-numbering as I described in my first
post (re-start numbering through VBA or in the "Bullets and Numbering" dialog,
since it only has to put in a re-start in the override table at the current
cursor position. Using that method, I was able to insert/remove re-starts
several times, and the document still contained only one "list table"
(including one named list template) and the necessary re-starts. As long as
you don't need to paste between documents, it works fine (as you can verify
with "MsgBox Selection.Range.ListFormat.ListTemplate.Name" or
"ActiveDocument.ListTemplates.Count" for outline numbered lists).

If you select something and apply the list template (or use the "Bullets and
Numbering"-dialog or toolbar buttons to apply the numbering to a few
paragraphs), it just makes a copy of the whole "list table"
(definition/template), and puts in the start of the new list in the "list
override table". After playing with a file as simple as my example above, and
re-applying the same list template a few times to different sections, I ended
up with four "list table" definitions and a dozen re-starts (of which some
stayed around even though they didn't seem to be used any more).
I used a named template "myList", and Word automatically created new templates
"myList2", "myList22", "myList222" ...

Since there may be only a maximum of 2000 entries in the override table
according to the RTF1.6-specs, I guess this should be responsible for much
document corruption.

If you paste something into another document, Word really messes it up
big-time: It keeps the re-starts (they would be hard to loose ...), but makes
two "list tables" (including templates): one for the first part up to the
first restart, and one for the rest. Since the override table *isn't* changed,
all restarts but the first will get lost (or pretty likely will re-start some
list in the new document that happens to have the same index in the override
table), and you get spaghetti numbering.

(I found out most of that by looking at the RTF-files imported as text, and
much of this came up already in earlier threads of Margaret Aldis, John
McGhie, John Nurick, Dave Rado and others)

So that seems to be the sorry story (and the end of my ambitions to "fix"
numbering ...)

Klaus

Hi Dave

Thanks again, Klaus

Klaus Linke schrieb:

Dave Rado

unread,
Jul 29, 2001, 2:55:39 PM7/29/01
to
LOL! List Numbering bugs are notoriously difficult to reproduce on demand.

A few more comments.

When I went through that exercise yesterday, I started by renaming
Normal.dot, starting and quitting Word and saving the "virgin" Normal.dot
that Word created. Then went back into Word, selected File + New + Template,
and saved the new template as Temp.dot. In the new template I selected
Format + Style, selected "List Number", and selected Modify + Format +
Numbering.

I immediately noticed that several of the List Gallery panes needed to be
reset, even though both my template and my Normal.dot were "out of the
box" - thus proving the FB&N list galleries get at least some of their
custom definitions from a machine-specific key in the registry, and not just
from the template. This is why, if you use the List Galleries collection,
your numbering can sometimes play "musical chairs" when someone else opens
your document on their machine.

Once I'd reset everything, I chose the 2nd scheme from the right on the top
row of the Outline tab, (the Legal numbering scheme), and selected Customize
+ More.

<Rant>: Note that by default, even when you are explicitly redefining a
numbering style, "Link Level to style" has no style selected by default!
It's as if Microsoft *want* your numbering to break!! </Rant>

I linked List Levels 1 - 3 to the List Number, List Number 2 and List Number
3 styles, respectively. Then I clicked back on List Level 1 to check whether
it had taken, and found that it hadn't - it was now claiming to be liked to
"no style"; so I linked it to the List Number style for the second time. I
then had to link List Level 2 to the List Number 2 style for the second
time. To my amazement, when I then clicked on List Level 3, it was still
linked to List Number 3! And List Level 2 was still linked to the List
Number 2 style when I then clicked back on that. But when I clicked back on
List Level 1, it was linked to "no style" yet again; so I linked it to the
List Number style for the third time. This time, it actually took! BTW, I've
never seen this particular problem in Word 97 and suspect that Microsoft
introduced this new bug in Word 2000 because they thought too many people
were getting the hang of defining their numbering styles properly, in Word
97, so they wanted to make it a bit harder! <g>

If you define your styles using VBA - and you can get 95% of the code for
doing this by using the macro recorder, as you pointed out, so it's not so
very hard - then if your lists ever do get screwed up, you can fix them
simply by replaying your macro, and you never have to go through that
heartbreakingly unpredictable user interface again - exactly the same code
can be used to define your styles and to subsequently relink your styles to
your named list templates if the link ever does break. IMO you've got it the
wrong way round - mere mortals like me find life much more stress free if we
use VBA to define and relink our numbering styles - only fearless supermen
and innocent young children would go near that dialog if they didn't have
to, IMHO.

I'm not sure why you don't like the "Dummy paragraph" method of restarting
numbering, BTW - it seems to me to make a lot of sense to take advantage of
the "Restart on higher level" feature. And the beauty of it is that it's
100% reliable, in my experience. With some simple macros it can be made
intuitive for ordinary users to use.

BTW, I just tried pasting one of those lists I created your way into an
document of my own in which the List Number styles were created using VBA.
1.
2.
3.
turned into:
1.
1.1.
9.

Pressing Ctrl+Q fixed it ....

Regards

Dave

"Klaus Linke" <fotosatz...@t-online.de> wrote in message
news:OOnZVsAGBHA.2056@tkmsftngp05...

Dave Rado

unread,
Jul 29, 2001, 3:35:25 PM7/29/01
to
Hi Klaus

~~~~~~~~~


I feel pretty stupid for having started this thread

~~~~~~~~~
You shouldn't - it's been illuminating! And you've added to the general pool
of understanding.

~~~~~~~~~


I hope John McGhie, Margaret Aldis and others will point out errors ;-)

~~~~~~~~~
I hope some of them will join in, anyway.

~~~~~~~~~


To start with, John says in his article "Word's numbering explained" at
http://www.mvps.org/word that Lists have a definition, a beginning, one or
more items, and an end. That makes sense, but is not so in Word97 and above.

~~~~~~~~~
I imagine he meant that if you *don't* use styles, but apply numberijg using
the numbering button, then if you select two separate blocks of text and
number them using the button, then
MsgBox ActiveDocument.Lists.Count
returns "2". (If you use styles it returrns "1").

~~~~~~~~~


Here, the definition of a list consists of two tables: a "list table" and a
"list override table". The list itself has *no* beginning and *no* end, only
re-starts.

~~~~~~~~~
I thought that was only the case if you apply numbering by applying styles?

~~~~~~~~~


The "list table" contains the list definition (including the template for
outline lists), the "list override table" contains a list of start-at- and
formatting-overrides. I will only consider the start-at-overrides in the
following.

[etc.]
~~~~~~~~~
Fascinating thanks for doing the research and sharing it.

~~~~~~~~~


Though this implementation of lists might look elegant at first sight, it
has
a terrible drawback: to get the numbering right, Word has to start counting
at
the beginning of the file, and re-start every time it hits a reference to
the
override table.

That works fine as long as you don't edit the file, and the people who
designed this format seem to have expected nobody ever would be so crazy and
copy/paste/insert/re-number or generally change anything.

~~~~~~~~~
LOL!!

I often think that a lot of Word was designed by people who never have to
actually use it .... <g>

~~~~~~~~~


I used a named template "myList", and Word automatically created new
templates
"myList2", "myList22", "myList222" ...

~~~~~~~~~
Yes, if you're going to use named List Templates you must never apply them
directly to text. In fact you should never apply numbering directly to text,
full stop.

~~~~~~~~~


Since there may be only a maximum of 2000 entries in the override table
according to the RTF1.6-specs, I guess this should be responsible for much
document corruption.

~~~~~~~~~
Word 2000 has a fix for this - see
http://support.microsoft.com/directory/article.asp?id=KB;EN-US;Q241581
Doesn't help if you email an about-to-become-corrupt document to someone who
hasn't applied the fix though.

~~~~~~~~~


If you paste something into another document, Word really messes it up
big-time: It keeps the re-starts (they would be hard to loose ...), but
makes
two "list tables" (including templates): one for the first part up to the
first restart, and one for the rest. Since the override table *isn't*
changed,
all restarts but the first will get lost (or pretty likely will re-start
some
list in the new document that happens to have the same index in the override
table), and you get spaghetti numbering.

~~~~~~~~~
Again, fascinating and thanks for researching this.


~~~~~~~~~


So that seems to be the sorry story (and the end of my ambitions to "fix"
numbering ...)

~~~~~~~~~
<g>

But the method Margaret came up with of applying restarts via styles
(assuming you've defined the styles using named list templates, and I'm
still not conviced the latter can be done reliably via the user interface,
I'd rather trust VBA) - is pretty stable in my experience.

Regards

Dave


Klaus Linke

unread,
Jul 29, 2001, 4:43:11 PM7/29/01
to
Hi again, Dave!

Seems everybody else is gone fishing this weekend (wish I had, too).

Had about the same problems producing a "clean" template and defining my
styles (I always got negative indents of ridiculous size, until I removed all
indents from the styles first -- should have heeded your advice), and will try
the macro approach next time (if I recuperate from this weekend's spar with
the bugs).

As I explained in the post that crossed yours, I don't think pasting from one
document into another *can* be successfull, except if the two documents are
based on the same template, and neither the styles nor the list templates have
been tampered with. In this (improbable) case you might get lucky, and the
references to the "list table" and to the "list override table" *might* be the
same in both documents.

The VBA interface to lists is as buggy as a heap of dung in the summer,
especially the .Lists-Collection is totally worthless. I only rely at looking
at the change in the RTF-output some action in Word produces.

To summarize my finds: As long as you re-start only one (single or outline
numbered) list, you can do that to your heart's delight -- *if* you don't
change the numbering of several paragraphs after selecting them, you never run
into trouble (style-based numbering taken for granted).

The simple reason is that all restart entries in the "list override table"
will refer to the same list.

(And to tackle your argument about "manual formatting": as long as Ctrl-Q also
removes character styles, that doesn't worry me that much)

If you cut/copy text from one part of the doc to another, you may get some
unnesseccary restarts (which doesn't hurt as long as you don't have to *read*
the stuff like I did today), and you should be aware that the restart travels
with the paragraph you applied it to.

If you plan to copy text between documents that include numbering, make sure
they are based on the same template, and don't tamper with the docs if you
don't absolutely need to, then your chances to get away unchafed are at least
a bit better (that should apply to all numbering, even without restarts).
Using named list templates you can always check which template is applied; if
you see more than one template for a given style or outline: beware! You are
invited to spaghetti.

I made a document of a few pages and changed the styles, indented/outdented
the numbered styles, cut and pasted at random, formatted with different manual
formatting, restarted and re-joined numbering for 15 minutes, then even
selected the whole file and sorted it alphabetically, and no problems
surfaced. The RTF showed some (in my opinion) un-nessecary restarts after that
heavy mangling, but everything else was o.k. (one list, one list template, no spaghetti).

So even if I'm all *for* using "Restart on higher level", I think that *is*
re-assuring news for all those editing existing documents: use style-based
numbering with named templates and re-starts only, get rid of unused list
templates as a precaution, and you might survive.

Good night Dave and everybody else, Klaus

Klaus Linke

unread,
Jul 29, 2001, 5:26:23 PM7/29/01
to
Dave Rado wrote:
>
> ~~~~~~~~~
> To start with, John says in his article "Word's numbering explained" at
> http://www.mvps.org/word that Lists have a definition, a beginning, one or
> more items, and an end. That makes sense, but is not so in Word97 and above.
> ~~~~~~~~~
> I imagine he meant that if you *don't* use styles, but apply numberijg using
> the numbering button, then if you select two separate blocks of text and
> number them using the button, then
> MsgBox ActiveDocument.Lists.Count
> returns "2". (If you use styles it returrns "1").
> ~~~~~~~~~

Better forget the .Lists-Collection; you will get "2" if you use styles, too.
And if you use .Lists(i).ListParagraphs on paragraphs where the numbering has
been done with styles and re-starts, you get crazy results.


> Here, the definition of a list consists of two tables: a "list table" and a
> "list override table". The list itself has *no* beginning and *no* end, only
> re-starts.
> ~~~~~~~~~
> I thought that was only the case if you apply numbering by applying styles?
> ~~~~~~~~~

No, that applies to all lists.


> ~~~~~~~~~
> Since there may be only a maximum of 2000 entries in the override table
> according to the RTF1.6-specs, I guess this should be responsible for much
> document corruption.
> ~~~~~~~~~
> Word 2000 has a fix for this - see
> http://support.microsoft.com/directory/article.asp?id=KB;EN-US;Q241581
> Doesn't help if you email an about-to-become-corrupt document to someone who
> hasn't applied the fix though.
> ~~~~~~~~~

That fix removes unused templates; but I guess if you use one list to number
your whole document using short 1)/2)/3) kind of lists that restart every few
lines, you might run into the 2000-restarts-barrier with very long documents.
So that's a good point for using a dummy "restart style".


> But the method Margaret came up with of applying restarts via styles
> (assuming you've defined the styles using named list templates, and I'm
> still not conviced the latter can be done reliably via the user interface,
> I'd rather trust VBA) - is pretty stable in my experience.

That is because it's the same method! I *stole* it (hope Margaret won't mind
and take my eternal gratitude as a recompensation); I only did a small part of
the research why it works, and why it sometimes don't.

Leaving ListNumbering Street for today,

Klaus

Dave Rado

unread,
Jul 29, 2001, 6:36:46 PM7/29/01
to
Hi Klaus

| Seems everybody else is gone fishing this weekend (wish I had, too).

<g>


| The VBA interface to lists is as buggy as a heap of dung in the summer

In some respects, but it lets you reference named list templates accurately,
in my experience.


| If you plan to copy text between documents that include numbering, make
sure
| they are based on the same template,

As long as all your (document) templates use named list templates, and as
long as, in each document template, the numbering styles of a given name are
linked to a list template that has the same name in both document templates
(e.g as long as your fax and letter templates both have their List Number
style linked to a list template called "NumberingTemplate"); and as long as
you use styles to resart numbering; then in my experience, you can copy and
paste lists between documents attached to different (document) templates to
your heart's content without any problems (even if the actual formatting
within the style definitions are very different in the different document
templates).


| and don't tamper with the docs if you
| don't absolutely need to,

My users tamper to their heart's content - but they never apply numbering as
direct formatting (they don't have access to do so); and they never apply
manual restarts - they only apply styles. Touch wood they've not had
spaghheti numbering in the past couple of years.

Sleep well!

Regards

Dave


John Nurick

unread,
Jul 30, 2001, 1:41:23 AM7/30/01
to
On Sun, 29 Jul 2001 23:36:46 +0100, "Dave Rado" <dr...@onetel.net.uk>
wrote:

>As long as all your (document) templates use named list templates, and as
>long as, in each document template, the numbering styles of a given name are
>linked to a list template that has the same name in both document templates
>(e.g as long as your fax and letter templates both have their List Number
>style linked to a list template called "NumberingTemplate"); and as long as
>you use styles to resart numbering; then in my experience, you can copy and
>paste lists between documents attached to different (document) templates to
>your heart's content without any problems (even if the actual formatting
>within the style definitions are very different in the different document
>templates).

Same here.

>| and don't tamper with the docs if you
>| don't absolutely need to,
>
>My users tamper to their heart's content - but they never apply numbering as
>direct formatting (they don't have access to do so); and they never apply
>manual restarts - they only apply styles. Touch wood they've not had
>spaghheti numbering in the past couple of years.

Same here - or none they couldn't fix by running a macro in the
Tools|Toolkit menu.


--
John

Please reply to the newsgroup and not by e-mail.
split $q,q[ acehJklnoPrstu]; $q.=$_[$_] for map hex, unpack
q,a,x29,q;89D010B3170A3B7041263B01D0177;;print qq;...$q.\n;

John Nurick

unread,
Jul 30, 2001, 1:41:22 AM7/30/01
to
Hello Dave & Klaus

On Sun, 29 Jul 2001 22:43:11 +0200, Klaus Linke
<fotosatz...@t-online.de> wrote:

I've been reading with interest but until now haven't had anything to
contribute that Dave hasn't already said.

>As I explained in the post that crossed yours, I don't think pasting from one
>document into another *can* be successfull, except if the two documents are
>based on the same template, and neither the styles nor the list templates have
>been tampered with. In this (improbable) case you might get lucky, and the
>references to the "list table" and to the "list override table" *might* be the
>same in both documents.

Pasting from one document to another is IME troublefree provided (1)
they use the same style names for the same purposes and (2) they use
listtemplates with the same names for the same purposes (i.e. attached
to identically-named styles). Pasting from a document that doesn't
meet these conditions can usually be done by first pasting (all but
the last paragraph mark) into a new document from an appropriate
templae and then removing manual formatting and applying the styles
(especially the list or numbered styles) in that template.

>The VBA interface to lists is as buggy as a heap of dung in the summer,
>especially the .Lists-Collection is totally worthless. I only rely at looking
>at the change in the RTF-output some action in Word produces.

I haven't explored the Lists collection in any depth; but like Dave I
find VBA creation (or re-definition) of named listtemplates entirely
troublefree provideed you follow the "rules" the team discovered.

--

Cindy Meister -WordMVP-

unread,
Jul 30, 2001, 5:11:38 AM7/30/01
to
Hi Klaus,

> You even have to leave out the final paragraph mark -- which proves that
> numbering as it's usually applied is a form of document corruption ;-)
>

No, it simply proves that list templates are stored in this corruption-prone
part of Word's binary file. Can't imagine who would come up with such a
brilliant way of handling things... Obviously someone who's never had to work
with Word in the real world!

> so restarting the numbering must be viewed as "manual
> formatting" in this sense.
>

Yes, it definitely is that.

> It would be nice if there was a way to re-start numbering at a given
> heading-level, the same way you can re-start after a given list level (again
> something for mswish ... or is that included in Wd2002 already?)
>

If the heading style is linked to specific list level, this happens
automatically. Or have I misunderstood?

> I'm still interested in the way the indent/outdent-buttons change the style
> when working on outline-numbered/bulletted styles (they do
> Selection.Range.ListFormat.ListIndent instead of Selection.Paragraphs.Indent
> in these cases ... I wonder if that changes the style reliably?)
>

In my experience, these buttons are NOT reliable; Shift+Alt+Left/Right arrow
is, though. I believe this functionality applies the next list level
formatting, so that would mean the .ListIndent is changed. Certainly, it will
override (remove) any indent applied to the paragraph, itself. Applying a list
level format to any paragraph does that.

-- Cindy

Cindy Meister -WordMVP-

unread,
Jul 30, 2001, 5:11:44 AM7/30/01
to
Hi Klaus,

> That works fine as long as you don't edit the file, and the people who
> designed this format seem to have expected nobody ever would be so crazy and
> copy/paste/insert/re-number or generally change anything.
>

Only too true - and the interface has been revamped in Word2002 for exactly
the reasons you state. When you copy/paste lists there, you have a choice
whether to continue or restart numbering (and this does generate a new list).
The addition of LIST STYLES also helps keep numbering "straightened out".
Generally, John McGhie and I came to the conclusion that if one uses the new
interfaces, and NEVER touches Format/Bullets and Numbering/Outline numbered,
things are pretty stable.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Dave Rado

unread,
Jul 30, 2001, 7:43:29 AM7/30/01
to
Hi Klaus

I forgot to respond to this bit:

| I'm still interested in the way the indent/outdent-
| buttons change the style

| when working on outline-numbered/bulleted styles (they do


| Selection.Range.ListFormat.ListIndent instead of
| Selection.Paragraphs.Indent
| in these cases ... I wonder if that changes the style
| reliably?)

In my experience, it does work reliably, subject to the
premise that you are using styles properly - but I don't
like it, as I find that it's far too confusing for users,
because as you say, it sometimes indents and sometimes
promotes/demotes.

I have put the OutlinePromote/Demote buttons onto the
Formatting toolbar, and I train beginners to use those
instead; and I train intermediate/advanced users to use
the Alt+Shift+Left/Right Arrow keyboard shortcuts.

IMO, the biggest problem with the indent/outdent-buttons -
and with the tab key, if you turn on the "tab sets indent"
setting - is that they promote/demote headings if your
headings happen to be numbered and don't if they don't, so
if you have some documents with numbered headings and some
with unnumbered ones, it's a useless shortcut. And also,
if you want to promote/demote body text to a heading,
those buttons don't ever work, whereas, with one
exception, OutlinePromote/Demote works in all scenarios.

The one exception (where Promote/Demote doesn't work as
one would wish) is if you are using custom (i.e. not built-
in) heading styles, and you want to use Promote/Demote to
convert a body text paragraph to the appropriate custom
heading. For instance, I use the built-in Heading styles
for main headings, and custom heading styles for Appendix
headings, because that's the only way you can get the
Appendix headings to appear at the right outline level in
Outline view. To get round the promote/demote problem,
I've intercepted the OutlinePromote and OutlineDemote
commands, so that do they work in context. So in my
templates, if the previous Heading in your document before
the selection is a "Heading x" style,
OutlinePromote/Demote converts the selected body text para
to the appropriate "Heading x" style (as it does out of
the box); but if it the previous Heading is an "Appendix
Heading x" style, my OutlinePromote/Demote macros convert
the selected body text para to the appropriate "Appendix
Heading x" style.

FWIW.

Regards

Dave

Klaus Linke

unread,
Jul 30, 2001, 3:21:45 PM7/30/01
to
Hi Cindy,

Thank you for your comments. I am glad to hear lists are handled better in Word2002.

> > so restarting the numbering must be viewed as "manual
> > formatting" in this sense.
> >
> Yes, it definitely is that.

I don't think it was planned this way. The design of lists in Word97 and above
*requires* restarts to make several numbered lists based on the same template.
Word itself inserts a restart for every list, and puts in re-starts every time
a level in an outline numbered list re-starts with 1.
Word keeps track of the re-starts it makes itself -- they are updated
correctly if you paste between documents, while the restarts you insert
manually are not.
So you have either to use a separate list definition ("list table", including
a copy of the list template) for every numbered list you insert (which leads
to spaghetti numbering), or use the "dummy restart"-workaround to do restarts
while having all numbered lists in the document belonging to the same list
(and the same list template).

> > It would be nice if there was a way to re-start numbering at a given
> > heading-level, the same way you can re-start after a given list level (again
> > something for mswish ... or is that included in Wd2002 already?)
> >
> If the heading style is linked to specific list level, this happens
> automatically. Or have I misunderstood?

Yes (see my first post in the thread), but you can not do that if the
heading(s) already are numbered, and restarting on a given (heading-)outline
level seems more elegant than including the heading style explicitly in the
outline numbered list.


> > I'm still interested in the way the indent/outdent-buttons change the style
> > when working on outline-numbered/bulletted styles (they do
> > Selection.Range.ListFormat.ListIndent instead of Selection.Paragraphs.Indent
> > in these cases ... I wonder if that changes the style reliably?)
> >
> In my experience, these buttons are NOT reliable; Shift+Alt+Left/Right arrow
> is, though. I believe this functionality applies the next list level
> formatting, so that would mean the .ListIndent is changed. Certainly, it will
> override (remove) any indent applied to the paragraph, itself. Applying a list
> level format to any paragraph does that.

Both Shift-Alt+Right arrow and the Indent button seem to do
Selection.Range.ListFormat.ListIndent when used on outline numbered
paragraphs. As far as I can see, the indent button calls the Word macro
"EinzugVergrößern" (Indent?), and Shift-Alt+Right arrow calls
"GliederungTieferstufen" (OutlineDemote?).
Since I don't use the outdent/indent buttons for indents anyhow (since they
are applied through the styles in my documents), and since you and Dave both
recommend "OutlinePromote/Demote", I'll use those in the future; thank you for
this tip! (BTW, are the word macros that are used in the toolbar buttons and
that are available as macros documented anywhere? Or can you even see/edit
their VBA code? I don't recall seeing anything about them in the online help.
Recording them does not give you the necessary information, since the recorded
code changes. For example, if you use the OutlineDemote-button it gives
different code on lists/on headings).

Greetings, Klaus

Dave Rado

unread,
Jul 30, 2001, 4:18:43 PM7/30/01
to
Hi Klaus

~~~~~~~~


(BTW, are the word macros that are used in the toolbar
buttons and that are available as macros documented
anywhere? Or can you even see/edit their VBA code? I don't
recall seeing anything about them in the online help.
Recording them does not give you the necessary
information, since the recorded code changes. For example,
if you use the OutlineDemote-button it gives different
code on lists/on headings).

~~~~~~~~
Not in the way that I think you mean. But the following
should help you:
http://www.mvps.org/word/FAQs/General/CommandsList.htm

Regards

Dave

Klaus Linke

unread,
Jul 30, 2001, 6:44:34 PM7/30/01
to
Hi John, hi Dave,

I fully agree with everything you said in your replies (though I must admit
again that I have little experience with lists ... but everything you said
rhymes with what I've learned about the way Word handles lists internally).


Unfortunately, I have failed to give a context for my reply yesterday, so both
of you misunderstood the following:

>> As I explained in the post that crossed yours, I don't think pasting from one
>> document into another *can* be successfull, except if the two documents are
>> based on the same template, and neither the styles nor the list templates have
>> been tampered with. In this (improbable) case you might get lucky, and the
>> references to the "list table" and to the "list override table" *might* be the
>> same in both documents.

I was referring to lists with manually inserted restarts only. Pasting those
can not work, because Word does not update the "list override table" in the
document you paste into. And I was even too optimistic in my comment above.
The "list overrides" (restarts) are numbered in the order in which they are
applied, and you need a different entry in that table for each re-start, so as
long as Word doesn't keep track of manually inserted restarts in the "list
override table", things *can not* work.


Since I've got some details wrong yesterday, here is another simple example.

You have a document template with an outline numbered list (named list
template "myList"), and 9 styles "myList1" ... "myList9" used in that list template.

The empty document will contain one entry \ls1 in the list override table,
that contains a reference to a list table for "myList" using the named list
template (to confuse matters some more, the reference is made indirectly by a
randomly generated long integer). The list template will contain the
definition of the nine outline list levels, with the style to use for each level.
All 9 styles contain \ls1.

If you put a pagaraph with style "myList1" into the document, Word will look
up the style definition, encounter "\ls1" there, then look up the "list table"
with the template to see which numbering to apply. Since that is the first
time the style (and \ls1) is encountered, numbering "1" will be inserted.

If you continue to add paragraphs with style "myList1", those are numbered,
since "\ls1" is encountered through the style definition each time.

If you insert a "manual" restart, Word puts in \ls2 at that location, and
makes an entry in the "list override table" that all levels of "myList" should
re-start with "1" from that point on. On the next re-start it will insert
\ls3, and so on.

If you now copy some text with multiple re-starts (say, \ls2, \ls3 and \ls4)
into another document, Word uses the same entry in the "list override table"
of the new document for *all* re-starts (say, \ls6). Only the first of these
re-starts will start re-numbering. The old re-starts (\ls3 and \ls4 in my
example) don't re-number, but you still have three re-starts \ls6 in the file.
If you delete the paragraph with the first re-start \ls6, then suddenly the
second re-start \ls6 becomes active, and re-numbering starts where \ls3 used
to be ...


So I have learned my lesson: Don't use restarts. It may work as long as you
only work with one document, but you get corrupt files if you paste into
another document.


Greetings, Klaus

Klaus Linke

unread,
Jul 30, 2001, 7:02:22 PM7/30/01
to CindyM...@swissonline.ch
> > If the heading style is linked to specific list level, this happens
> > automatically. Or have I misunderstood?
>
> Yes (see my first post in the thread), but ...

Sorry Cindy, that was formulated *terribly*; of course it should have been "No
(see my first post ...)"! Haven't had my regular "Büroschlaf" (office-nap)
today ;-)

Klaus

Klaus Linke

unread,
Jul 30, 2001, 7:58:58 PM7/30/01
to
> So I have learned my lesson: Don't use restarts. It may work as long as you
> only work with one document, but you get corrupt files if you paste into
> another document.

... or if you already have documents which use numbered lists with restarts,
paste the lists into other documents one at a time, to avoid problems.

Klaus

Cindy Meister -WordMVP-

unread,
Jul 31, 2001, 4:28:41 AM7/31/01
to
Hi Klaus,

> BTW, are the word macros that are used in the toolbar buttons and
> that are available as macros documented anywhere?
>

If commands come from Word95 or earlier, you'll often find
something in the Word Developers Handbook, 3rd edition, because
these were also the WordBasic commands to perform the action. And
you can use any of these with the syntax WordBasic.CommandName

Dave Rado

unread,
Jul 31, 2001, 6:30:25 AM7/31/01
to
Hi Klaus

~~~~~~~~


(BTW, are the word macros that are used in the toolbar buttons and that are
available as macros documented anywhere? Or can you even see/edit their VBA

code? Recording them does not give you the necessary information, since the
recorded code changes.
~~~~~~~~
If you press Alt+F8, type the English command and press "Create" you'll get
*something* but what you get doesn't always do exactly the same as the
command does (though it's often better than using the recorder). Problem is
that the Word commands run C++ code, and they often don't have a direct VBA
equivalent.

In terms of getting the right Engish command to type, see the following:
http://www.mvps.org/word/FAQs/General/CommandsList.htm


~~~~~~~~


For example, if you use the OutlineDemote-button it gives
different code on lists/on headings).

~~~~~~~~
I don't know why the recorder does that, in this instance - as far as I can
tell, Selection.Paragraphs.OutlineDemote always does what the command does -
and that's the code the Alt+F8 method gives you.

Regards

Dave


John McGhie

unread,
Jul 30, 2001, 8:03:33 PM7/30/01
to
Hi Klaus:

On 7/28/01 5:00 PM, in article e1pQVJzFBHA.1128@tkmsftngp04, "Klaus Linke"
<fotosatz...@t-online.de> wrote:

> I finally got around to reading the thread
>
> Nightmare on ListNumbering Street
> http://groups.google.com/groups?hl=en&th=9e790fa7ed2886b3,18&ic=1
>
> Frankly, I don't understand the problems everybody has with numbering.

As you have explained, that is because neither you nor your users work with
it very often. Word will often "let you get away with things" for two or
three edits, and that's all some documents ever get. ALL of my documents
contain list numbering. ALL of them have numbered headings as well. ALL of
my users cut-and-paste between documents. Many of those documents were
originally created in Word 6 around 1987.

> If I get documents that have not been done using styles, I remove all
> numbering and bullets, check if all list templates have been removed, then
> define the numbering in the styles.

Dave has already addressed that one: you can't remove the list templates by
removing the numbering. You can only remove the lists.

> Defining named list templates doesn't require VBA, as far as I can see;
> you just type in the name in the bottom left of the dialog "Format >
> Bullets and Numbering > Outline Lists > Modify" when you define it.

Which is exactly how Word 2002 does it. However, if you then make a change,
Word creates a NEW list template and adds it to the collection. If you use
VBA, you can ensure that the list template you are operating on is "the"
specific list template you want, the one you know is applied to all the
lists. If you edit numbering using Format>Bullets and Numbering you create
a NEW list template each time.


>
> Restarting the numbering doesn't seem to require any tricks either,
> the two toggle buttons in the "Bullets and Numbering" dialog
> (o Restart numbering / o Continue list) work well. They *do* use the
> list galleries, so recording clicking those buttons, trimming, and
> replacing the ListGallery references with the named List Template, I get:
>
> Dim myLT As ListTemplate
> Set myLT = ActiveDocument.ListTemplates("myList")
> Selection.Range.ListFormat.ApplyListTemplate _
> ListTemplate:=myLT, _
> ContinuePreviousList:=False, _
> ApplyTo:=wdListApplyToWholeList, _
> DefaultListBehavior:=wdWord9ListBehavior
>
> to start renumbering, and if you want to re-join the lists, you'd use
> ... ContinuePreviousList:=True, _

This code creates a new list template each time. The name is not an entry
into the item index for the ListTemplates collection. If you want a
specific list template you have to access it by ordinal number or enumerate
the collection and look for it.


>
> (Praise to the macro recorder; I would have tried any parameter but
> "wdListApplyToWholeList"!)

I've been attending that church for years :-)


>
> This does not produce new List Templates.

Your code would. But you are correct, you can restart numbering using
Format>Bullets and Numbering without doing so, because in that instance you
are accessing the list templates through the ListGalleries collection.

> Since you probably want to remove the dialog anyhow to protect innocent
users
> from wreaking havoc, you could use toolbar buttons for restarting/joining
> lists. With a bit of sweat, you could perhaps come up with *one* toggle
button
> to do both actions (though I don't see how at the moment).

I don't hold with removing commands because you think users are too stupid
to use them. Microsoft does that, and it's in my opinion the major cause of
resentment about Microsoft software. Paternalism is NEVER appreciated.
What I do is to put the commands I would rather they did not use on a
different toolbar. I tell them where they are, and why I would rather they
did not use them. But I never remove them.

> You could also put in a hidden field { LISTNUM "myList" \s0 } to restart
> numbering (in an extra, hidden paragraph), and delete it when you want the
> list to continue, but that is a bit clunky.

I strongly oppose hidden fields or hidden styles or hidden anything else in
corporate documents. They create maintenance nightmares for years
afterwards, and people waste hours on them. The big problem is that the
"next" user does not know they are there, does not expect them, and screws
up the document as a result.

> (That seems to be the way numbering
> is recommended to be applied generally, as far as I understood the other
> threads: putting a "dummy" style at the top to restart numbering)

For the reason just outlined, I do not use "dummy" styles either. It's a
perfectly acceptable technique, and used to be common in professional
technical writing. However, it creates the same maintenance horror. And
these days, since so much content generation is done directly by the
subject-matter experts I find it best to steer clear of the special stunts
that technical writers used to get up to. It works well, but it requires
trained technical writers to work with it, and most companies can't afford
many of those these days. I see the "Dummy Style" technique and the "Named
List Template" technique as essentially two opposing choices: either will
work well, just for god's sake don't mix them in a document. Word 2002 has
implemented Named List Templates as the built-in default method.


>
> It would have been nice if you had the choice to restart numbering every
time
> a paragraph without numbering is inserted. As far as I can see, somebody
at
> Microsoft ruined that by interpreting ".ResetOnHigher=0" to mean
> ".ResetOnHigher=False" instead of interpreting "0" as the numbering level.

Set ContinuePreviousList to False and the numbering will reset at that
point. That's how Dave's button works too, I think.


>
> I'm sorry if some of this already came up in earlier discussions, I didn't
> read them all. Perhaps I somehow missed the point :-/

No, I don't think it has, and I don't think you have missed the point at
all. With the roll-out of Word 2002, I think more and more people are going
to need to understand this mechanism, because that's now it works.

Cheers

--
Please post replies to the newsgroup to maintain the thread.

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

Dave Rado

unread,
Jul 31, 2001, 10:40:17 AM7/31/01
to
Hi John

| I don't hold with removing commands because you think users are too stupid
| to use them.

You don't have to be stupid not to be able to use the FB&N dialog
succesfully - or if you do, I'm certainly very stupid. :-)

Knowledgable users never use that dialog; less knowledgable ones don't miss
it if it's not there, provided you provide them with alternatives that make
it easy for them to get their numbering done, in the way they need it to be
done; and provided you show them how to use them (training is key). In
addition, I replace rather than remove buttons whenever I can; so there is
still a numbering and a bulleting button on my users' Formatting toolbar,
they look identical to the MS ones, but they work by applying styles.

If people do use FB&N in a company environment they are not only screwing up
their own documents, they are seriously damaging the productivity of
everyone else who will have to paste from their documents in the future.
Preventing that from happening is not paternalism, it's business sense. I
have not had any complaints from any of my users yet about that missing
dialog (Although I do provide a convoluted back door route to the dialog
replete with messages warning about the dangers of corruption if they use
it)


| I strongly oppose hidden fields or hidden styles or hidden anything else
in
| corporate documents. They create maintenance nightmares for years
| afterwards, and people waste hours on them.

The numbering buttons which my users have access to add and remove the dummy
paras as required. No maintenance nightamre, their documents are a dream to
maintain. Documents containing manually restarted numbering are a real
maintenance nightmare. My users spend far less time on numbering than most
people, because their numbering simply works, all the time.


| The big problem is that the
| "next" user does not know they are there, does not expect them, and screws
| up the document as a result.

My users do not know they are there, but they do know about the buttons, and
they don't screw up their documents.


| It works well, but it requires
| trained technical writers to work with it,

My users are anything but. None of them are at all Word-savvy, but they do
know how to use the buttons I've provided.

Also, I am far from being only one who has had success in a corporate
evironment with this tecnique. John Norick and Margaret Aldis in this
newsgroup have followed the same policy, with great success - it was them
that I got the idea for it from - and so have many others, who have emailed
me privately.


| and most companies can't afford
| many of those these days. I see the "Dummy Style" technique and the
"Named
| List Template" technique as essentially two opposing choices: either will
| work well, just for god's sake don't mix them in a document.

All my outline list styles used for numbering body text use named list
templates and a dummy style to restart numbering. If you restart numbering
in any other way, you will get corrupt numbering when you copy and paste
between documents.

Regards

Dave


Klaus Linke

unread,
Jul 31, 2001, 6:29:32 PM7/31/01
to
Hi Dave,

Thank you very much for all your tips; much of that was totally new to me, and
it will take a while to check everything out.
It's funny Word uses C++ to call some VBA functions. I know some old WordBasic
commands have no VBA-counterpart, or offer speed advantages.
It might take another "weekend project" to check the list of Word commands to
see if/when calling them offers advantages (speed/functionality) over using
VBA directly -- or what's usable at all; some commands didn't seem to work
when I tried them: they seem to depend on an active Chinese/Japanese... support).

Greetings, Klaus

Dave Rado wrote:
>
Hi Klaus

~~~~~~~~
> (BTW, are the word macros that are used in the toolbar
> buttons and that are available as macros documented

> anywhere? Or can you even see/edit their VBA code? I don't

> recall seeing anything about them in the online help.

> Recording them does not give you the necessary

> information, since the recorded code changes. For example,

> if you use the OutlineDemote-button it gives different
> code on lists/on headings).
~~~~~~~~

Not in the way that I think you mean. But the following
should help you:
http://www.mvps.org/word/FAQs/General/CommandsList.htm

Regards

Dave

> ~~~~~~~~

Dave Rado

unread,
Jul 31, 2001, 8:15:30 PM7/31/01
to
Hi Klaus

| It's funny Word uses C++ to call some VBA functions.

I didn't mean that I meant it uses C++ to run its own built-in commands.

Regards

Dave


Klaus Linke

unread,
Jul 31, 2001, 8:29:21 PM7/31/01
to
Hi John,

Since you contradicted (or plain didn't believe) many things in my previous
posts, I hope you won't mind if I do the same ;-)
But first, I want to thank you for your article at mvps.org/word, and many
posts on these newsgroups, that helped me very much to understand numbering
(and the problems in Word2000).

So we don't talk cross purposes (and to get others up-to-date): The main issue
is how to do numbered lists with re-starts (1./2./3. ... 1./2. ...) in Word
2000.

If you use the "bullets and numbering" dialog to make a numbered list, and
then re-start the list, you get different lists for each re-start. This leads
to spaghetti numbering if you then copy/paste from one list to another (If you
have two lists 1./2./3. ... 1./2./3. and move 2. from the second list into the
first list, after the second entry, you get 1./2./1./3. ... 2./3.)

So this approach seems out of the question from the start.

Using list styles, you don't run into this problem, you can paste to your
heart's delight, and the list numbers will be updated correctly (1./2./3./4.
... 1./2. in my example above).

So in my youthful brashness I first thought you could just re-start the
numbering (either in the dialog or by VBA), and wondered why Margaret Aldis,
Dave Rado and others recommended other ways.

As I very soon found out myself (and as you and others had discovered long
ago), this only works as long as you edit a single document. If you copy/paste
into another document, most re-starts will not work.

Every restart needs a different entry in the "list overrides"-table, and Word
2000 does not correctly update that table in the document you paste into. The
re-starts will still be copied into the new document, but since they all have
the same entry in the "list overrides table", only the first re-start *will*
re-start. Delete that paragraph, and suddenly the second re-start will become
active ...

BTW, pasting the re-started lists one at a time doesn't work either (I first
thought this might be a work-around, but Word2000 still gets it messed up).


> I strongly oppose hidden fields or hidden styles or hidden anything

> else in corporate documents. [...]

Since everything else fails, you need to have some work-around for that bug,
and the "dummy style" is the most elegant I have seen so far. In many
simply-structured documents you can use a heading style to re-start numbering,
as suggested by Cindy and in my first post.


> I see the "Dummy Style" technique and the "Named
> List Template" technique as essentially two opposing choices:
> either will work well, just for god's sake don't mix them in a
> document.

As far as I can see, using named list templates alone won't help you at all
with the re-start-problem in Word 2000, and I don't see a reason not to use
named list templates with the "Dummy Style" technique (perhaps things are
different in Word2002).


You didn't believe some other statements I made in the previous posts, either;
so for the record:

> > If I get documents that have not been done using styles, I remove all
> > numbering and bullets, check if all list templates have been removed, then
> > define the numbering in the styles.
>
> Dave has already addressed that one: you can't remove the list templates by
> removing the numbering. You can only remove the lists.

As Dave and Cindy said (and I in my reply) you can do it by pasting everything
but the last paragraph mark into another document. I do that after I have
cleaned up the doc (replaced manual numbering ... with the right styles) if I
get documents that don't use styles. Up to now I had no problems getting the
count of used lists down to the 1 or 2 I actually need.
It probably would not hurt to leave the unused lists ("list table"
definitions) in the document, but I clean up many documents anyway (and it
reduces the size a bit, too).


> [...] This code creates a new list template each time. The name is not an entry


> into the item index for the ListTemplates collection. If you want a
> specific list template you have to access it by ordinal number or enumerate
> the collection and look for it.
> >

> [...]


> >
> > This does not produce new List Templates.
>
> Your code would. But you are correct, you can restart numbering using
> Format>Bullets and Numbering without doing so, because in that instance you
> are accessing the list templates through the ListGalleries collection.

I have checked very well that it didn't create a new list template (both by
using VBA and by looking at the RTF). The code I posted is the stuff you get
when you record using the restart/join buttons in the "bullets and numbering"
dialog, edited a bit to remove reference to the "List Galleries". While I am
aware that using the macro recorder often doesn't give you the correct
VBA-code, in this case the macro did exactly what I expected (put in re-starts
without creating a new list). Maybe this code runs into problems sometimes,
and maybe there are other ways to re-start that are safer, but since re-starts
run into problems in Word2000 anyhow, that's probably of academic interest only.


> I don't hold with removing commands because you think users are too stupid
> to use them. Microsoft does that, and it's in my opinion the major cause of
> resentment about Microsoft software. Paternalism is NEVER appreciated.
> What I do is to put the commands I would rather they did not use on a
> different toolbar. I tell them where they are, and why I would rather they
> did not use them. But I never remove them.

I guess we both do it the same way, then -- base the documents on a specific
template, and display customized toolbars. I don't keep the authors from
re-displaying the "Standard" and "Formatting" toolbars, but I explain that
additional costs may come up if they use anything but the buttons present on
the customized toolbars, and since my toolbar(s) contain anything they need
(often including things done by macros they *wouldn't* be able to do with the
standard toolbars), that works pretty well.

Regards, Klaus

Klaus Linke

unread,
Aug 1, 2001, 1:39:15 AM8/1/01
to
Hi John,

Sorry, I didn't read your last message carefully enough. Of course you are right:


Set myLT = ActiveDocument.ListTemplates("myList")

just worked by accident.


Klaus


> > Restarting the numbering doesn't seem to require any tricks either,
> > the two toggle buttons in the "Bullets and Numbering" dialog
> > (o Restart numbering / o Continue list) work well. They *do* use the
> > list galleries, so recording clicking those buttons, trimming, and
> > replacing the ListGallery references with the named List Template, I get:
> >
> > Dim myLT As ListTemplate
> > Set myLT = ActiveDocument.ListTemplates("myList")
> > Selection.Range.ListFormat.ApplyListTemplate _
> > ListTemplate:=myLT, _
> > ContinuePreviousList:=False, _
> > ApplyTo:=wdListApplyToWholeList, _
> > DefaultListBehavior:=wdWord9ListBehavior
> >
> > to start renumbering, and if you want to re-join the lists, you'd use
> > ... ContinuePreviousList:=True, _

Dave Rado

unread,
Aug 1, 2001, 6:11:12 AM8/1/01
to
Hi Klaus

You've lost me there - could you expand on that?

Regards

Dave

"Klaus Linke" <fotosatz...@t-online.de> wrote in message

news:eWlagukGBHA.1972@tkmsftngp04...

Klaus Linke

unread,
Aug 1, 2001, 3:27:46 PM8/1/01
to
Hi Dave,

The online help to the .Item method says there are three ways to specify an
item:
-- by ordinal number, as in ActiveDocument.Styles(1)
(number from 1 to the value of the collection's Count property)
-- by a constant, as in ActiveDocument.Styles(wdStyleHeading1)
-- by a string, as in ActiveDocument.Styles("Heading 1")

Using a string (the list template's name) doesn't work with the ListTemplates
collection, as John pointed out.
It worked with the simple examples I tried it on, and I even got an error
message "Item not in Collection" when I mis-typed the name, so I thought it
worked perfectly, but it fails on more complicated documents.

Following Johns suggestion, to re-start a list (using a list style with a
named list template "myList") you would have to look for the list template in
the collection:

Dim myListTemplate As ListTemplate
For Each myListTemplate In ActiveDocument.ListTemplates
If myListTemplate.Name = "myList" Then
Selection.Range.ListFormat.ApplyListTemplate _
ListTemplate:=myListTemplate, _


ContinuePreviousList:=False, _
ApplyTo:=wdListApplyToWholeList, _
DefaultListBehavior:=wdWord9ListBehavior

End If
Next myListTemplate

instead of the code I posted (hope I got it right this time).

Greetings, Klaus

Dave Rado

unread,
Aug 1, 2001, 4:34:40 PM8/1/01
to
Hi Klaus

I'm with you now - but whereas, normally, applying a named list template
directly to text creates a new list template and appends 2 to the name, and
doesn't apply the one you specified at all, your restart code doesn't appear
to do this, as you said before (I'm not sure why). But as you also
discovered, it all collapses if you then paste into other documents, so in a
way it's academic ...

Regards

Dave


"Klaus Linke" <fotosatz...@t-online.de> wrote in message

news:ODb4IcsGBHA.1380@tkmsftngp05...

Klaus Linke

unread,
Aug 1, 2001, 5:58:32 PM8/1/01
to
Hi Dave,

Yes, I should have added a warning *not* to use that code for those who
haven't followed the whole thread.
If somebody should need to do it anyway, he could use
Selection.Range.ListFormat.ListTemplate.Name instead of "myList" to restart
the right list.

I would like to know if the pasting-bug has been fixed in Word2002 (John
McGhie's answer seemed to imply that).

There probably are a lot of documents out there using list styles, and
re-starts manually applied from the "Bullets and Numbering" dialog.
You probably could "convert" them to using the "Dummy Restart"-method:
-- cycle over the Lists.Collection, checking for the list-style "myList",
-- put tags "<Restart myList>" at the beginning of each list using the style
"myList",
-- change to a list template using a dummy restart-style,
-- replace "<Restart myList>" with "Restart"-paragraphs.

Also, there probably are many documents containing "widowed" restarts, that
were inserted by pasting. As far as I can see, there is no way to find or
delete them using VBA; maybe you might be able to clean them up by saving as
RTF and deleting the widowed \ls entries there. Maybe Word2002 will do that on
import, too.

Regards, Klaus

Dave Rado wrote:
>
> Hi Klaus
>

Klaus Linke

unread,
Aug 1, 2001, 10:26:26 PM8/1/01
to
Hi Dave,

Perhaps we shouldn't discard this too fast ... I still think that using list
styles (and preferably a named list template, with the list styles bound to
that template), then using restarts is the way Word's numbering must have been
meant to work (given the list model Word uses). If pasting is the only
problem, you could append the file you want to paste from, and work with a
split screen. This might be a little cumbersome, but so are "dummy restart paragraphs".

If Word2002 uses named list templates as the default, and the bugs of Word2000
have been fixed, then doing things this way would make sense IMO. I hope
someone who already uses Word2002 can comment on that (make a dozen paragraphs
formatted in a list style, insert some re-starts, and paste into a new file:
are all re-starts -- not just the first -- still working?)

(I probably also have been too pessimistic about locating widowed re-starts
using VBA: Since deleting a re-start (= joining) will not change the number of
lists in the document if (and only if) there was a widowed re-start in the
same list, that might give you some handle to locate them)

Regards, Klaus


Dave Rado wrote:
>
> Hi Klaus
>

> I'm with you now - but whereas, normally, applying a named list template
> directly to text creates a new list template and appends 2 to the name, and
> doesn't apply the one you specified at all, your restart code doesn't appear
> to do this, as you said before (I'm not sure why). But as you also
> discovered, it all collapses if you then paste into other documents, so in a
> way it's academic ...
>
> Regards
>
> Dave
>

>> [edited]


>> Following Johns suggestion, to re-start a list (using a list style
>> with a named list template "myList") you would have to look for the
>> list template in the collection:
>>
>> Dim myListTemplate As ListTemplate

>> Dim myLTName
>> myLTName=Selection.Range.ListFormat.ListTemplate.Name


>> For Each myListTemplate In ActiveDocument.ListTemplates

>> If myListTemplate.Name = myLTName Then


>> Selection.Range.ListFormat.ApplyListTemplate _
>> ListTemplate:=myListTemplate, _
>> ContinuePreviousList:=False, _
>> ApplyTo:=wdListApplyToWholeList, _
>> DefaultListBehavior:=wdWord9ListBehavior
>> End If
>> Next myListTemplate

>

Klaus Linke

unread,
Aug 2, 2001, 1:02:26 AM8/2/01
to
Hi Dave, hi folks,

I'd hate to give up on this too easily ... I still think that using list


styles (and preferably a named list template, with the list styles bound to

that template), then using restarts, is the way Word's numbering must have


been meant to work (given the list model Word uses).

If pasting is the only problem, perhaps running a macro after pasting to
re-activate the "widowed" re-starts might still work somehow.
I probably have been too pessimistic about locating widowed re-starts using


VBA: Since deleting a re-start (= joining) will not change the number of lists
in the document if (and only if) there was a widowed re-start in the same

list, that might give you some handle to locate them. At the moment I don't
have time to work on that (I should be doing something else *right now*...).

Running a macro might be a little cumbersome, but so are "dummy restart paragraphs".

If Word2002 uses named list templates as the default, and the bugs of Word2000
have been fixed, then doing things this way would make sense IMO. I hope
someone who already uses Word2002 can comment on that (make a dozen paragraphs
formatted in a list style, insert some re-starts, and paste into a new file:

are all re-starts -- not just the first -- still working? Or, checking for
another bug that irritates me in Word2000: Does searching for a list style and
replacing by the same list style remove the re-starts in Word2002 (leaving the
"Find what" and "Replace with" boxes empty)?)


Regards, Klaus


Dave Rado wrote:
>
> Hi Klaus
>
> I'm with you now - but whereas, normally, applying a named list template
> directly to text creates a new list template and appends 2 to the name, and
> doesn't apply the one you specified at all, your restart code doesn't appear
> to do this, as you said before (I'm not sure why). But as you also
> discovered, it all collapses if you then paste into other documents, so in a
> way it's academic ...
>
> Regards
>
> Dave
>

>> [edited]


>> Following Johns suggestion, to re-start a list (using a list style
>> with a named list template "myList") you would have to look for the
>> list template in the collection:
>>
>> Dim myListTemplate As ListTemplate

>> Dim myLTName
>> myLTName=Selection.Range.ListFormat.ListTemplate.Name


>> For Each myListTemplate In ActiveDocument.ListTemplates

>> If myListTemplate.Name = myLTName Then


>> Selection.Range.ListFormat.ApplyListTemplate _
>> ListTemplate:=myListTemplate, _
>> ContinuePreviousList:=False, _
>> ApplyTo:=wdListApplyToWholeList, _
>> DefaultListBehavior:=wdWord9ListBehavior
>> End If
>> Next myListTemplate

>

> Hi Dave,
>
> Yes, I should have added a warning *not* to use that code for those who
> haven't followed the whole thread.
> If somebody should need to do it anyway, he could use
> Selection.Range.ListFormat.ListTemplate.Name instead of "myList" to restart
> the right list.
>
> I would like to know if the pasting-bug has been fixed in Word2002 (John
> McGhie's answer seemed to imply that).
>
> There probably are a lot of documents out there using list styles, and
> re-starts manually applied from the "Bullets and Numbering" dialog.
> You probably could "convert" them to using the "Dummy Restart"-method:
> -- cycle over the Lists.Collection, checking for the list-style "myList",
> -- put tags "<Restart myList>" at the beginning of each list using the style
> "myList",
> -- change to a list template using a dummy restart-style,
> -- replace "<Restart myList>" with "Restart"-paragraphs.
>
> Also, there probably are many documents containing "widowed" restarts, that
> were inserted by pasting. As far as I can see, there is no way to find or
> delete them using VBA; maybe you might be able to clean them up by saving as
> RTF and deleting the widowed \ls entries there. Maybe Word2002 will do that on
> import, too.
>

> Regards, Klauss

Dave Rado

unread,
Aug 2, 2001, 5:28:16 AM8/2/01
to
Hi Klaus

| I'd hate to give up on this too easily ... I still think that using list
| styles (and preferably a named list template, with the list styles bound
to
| that template), then using restarts, is the way Word's numbering must have
| been meant to work (given the list model Word uses).

In 97 and 2000 I'd be surprised if the idea that you should name your list
templates when you define your styles, and reference the list templates by
name when you redefine or relink them, and use the same list template names
for a given purpose accross all your document templates, had occured to MS -
certainly I've never seen any MS articles recommending this approach. I
believe the first person who had the idea was Bill Coan.


| Running a macro might be a little cumbersome, but so are "dummy restart
paragraphs".

The latter aren't cumbersome to the user, though (depending on how you
implement it, of course).


| I hope
| someone who already uses Word2002 can comment on that (make a dozen
paragraphs
| formatted in a list style, insert some re-starts, and paste into a new
file:
| are all re-starts -- not just the first -- still working? Or, checking for
| another bug that irritates me in Word2000: Does searching for a list style
and
| replacing by the same list style remove the re-starts in Word2002 (leaving
the
| "Find what" and "Replace with" boxes empty)?)

Yes I hope so too.

Regards

Dave


Dave Rado

unread,
Aug 2, 2001, 8:21:17 AM8/2/01
to
Hi Klaus

~~~~~~~


Using a string (the list template's name) doesn't work
with the ListTemplates collection, as John pointed out.
It worked with the simple examples I tried it on, and I
even got an error message "Item not in Collection" when I
mis-typed the name, so I thought it worked perfectly, but
it fails on more complicated documents.

~~~~~~~
I imagine that must explain why, when I orginally tried
your code, it unlinked my style from its named list
template (so that running:
MsgBox Selection.Range.ListFormat.ListTemplate.Name
returned nothing afterwards). I haven't been abe to
reproduce it since, so maybe it depends what other list
templates happen to be in the document at the time (or
maybe it even partly depends on what list templates are in
the "custom list template registry key" at the time)?

Regards

Dave


Dave Rado

unread,
Aug 2, 2001, 8:31:08 AM8/2/01
to
Hi Klaus

Another problem with using manual restarts (even if you
use named list templates): supposing you have:

1. text
2. text
3. text
text
1. text
2. text
3. text

where the second 1. has restart applied.

If you re-order the second list by dragging the 2. above
the 1. you end up with:
4.
1.
2.

And another point is that if you upadate styles from
template, manual restarts sometimes get lost, although I
can't reproduce that "on demand".

Regards

Dave

John McGhie

unread,
Aug 3, 2001, 7:34:13 AM8/3/01
to
Hi Klaus:

On 8/2/01 3:02 PM, in article eXzVm#wGBHA.968@tkmsftngp07, "Klaus Linke"
<fotosatz...@t-online.de> wrote:

> Hi Dave, hi folks,
>
> I'd hate to give up on this too easily ... I still think that using list
> styles (and preferably a named list template, with the list styles bound to
> that template), then using restarts, is the way Word's numbering must have
> been meant to work (given the list model Word uses).

I think (actually, I "know", through discussions with someone who worked on
the code...) that there are actually THREE "use cases" involved in the
design of Word's numbering bugs :-)

1) New users should be able to point-and-click. List Galleries was
designed for them.

2) Experienced users should be able to bind everything to styles. Styles
were designed for them. SEQ fields and ListNum fields were carried over for
backwards compatibility and to provide functionality such as numeric
pictures that List Templates do not provide.

3) Lawyers wanted the formatting of the numbering to determine the
formatting of the paragraph. And that's where the rot set in. This last
use case is what has created the circular references between the two
mechanisms that pulls the whole damned thing unstuck.

OK, I really don't have the time to carefully analyse what Klaus has
produced this weekend. I am very grateful to you for producing it, Klaus,
and I will go carefully through it sometime.

I am not sure how to respond you your "pasted restarts" bug. This is a new
one to me. Users in our shop (mainly software developers who, in
word-processing are challenged by the complexity of Notepad...) have been
cheerfully cutting, pasting and dragging text around from document to
document in our shop for some time without complaining about the pasted
restarts bug. Maybe they're just fixing it each time and not telling me.
My macros will fix the numbering by re-applying it if they use the
Select/Apply method.

What my macro does is apply the style, then check to see if the associated
list template exists in the document. If it does not, the macro then calls
another macro that creates all the styles and list templates required, names
the list templates, and binds each style to the appropriate level of the
appropriate list template.

And I have just notice this means there is a yawning gap in my logic: I do
not currently check that the named list template is in fact attached to the
correct style :-) So my macro will fail if ever the styles get re-attached
to the incorrect list templates. Since the majority of the documents were
either created from the master template (so the list templates already have
their styles attached) or the list templates did not exist at all, this
seems to be working reliably. But it's a bug :-)

The macros I use that apply paragraph numbering always set
"ContinuePreviousList" to False. As Kurt points out, this creates each list
as a different list, which for numbering is what you usually want. For
headings, you usually want the entire list to be contiguous and you never
restart it.

My macro relies on a bug in the numbering mechanism: If "all" the
paragraphs in a contiguous range are set to "ContinuePreviousList = False",
only the first Continue will operate. This is the same bug relied upon by
the Bullets and Numbering dialog. If the first paragraph in the list is
removed, the list will restart at the second. If another restart is added
to the middle of the range, it will be ignored. Fortunately I have not
examined the code actually produced so I have been spared the horror Klaus
is staring aghast at. But I guess this is the reason my userrs are not
noticing problems. The lists attempt to restart at every paragraph: Word
ignores this unless there is an intervening non-list paragraph.

One question that entertains my pathetic excuse for a mind is "Have we
proved that what Klaus is seeing in the RTF is what is actually happening in
the document?" I achieved my understanding of the mechanism by looking at
the HTML Word writes. This does not seem to contain the overrides table
Klaus speaks of. So I wondered: Is it the case that what Klaus is seeing
in the RTF is also happening in the binary? I don't know either.

Klaus Linke

unread,
Aug 4, 2001, 2:58:05 AM8/4/01
to
Hi John,

I don't know if RTF gives you a good picture as to how things are handled in
Word (for example whether there *is* such a thing as a "list override table"
in memory when you open a document), and since I don't know much about RTF,
you should take my "analysis" in the previous posts with a grain of salt. I
only look at the RTF (and the RTF spec) as a last resort, when I have no idea
how something in Word is done.


> I think (actually, I "know", through discussions with someone
> who worked on the code...)

I hope you spared his life ;-) They really don't have an easy job. It's my
guess that (most) bugs in numbering should have been easy to fix in a service
pack, but they didn't because applying the fixes would have changed the
numbering in existing documents.


> 3) Lawyers wanted the formatting of the numbering to determine the
> formatting of the paragraph. And that's where the rot set in.
> This last use case is what has created the circular references between
> the two mechanisms that pulls the whole damned thing unstuck.

Lawyers get their money for making simple things complicated (excuses to
Charles Kenyon and other legal practicioneers)


> [...] and I will go carefully through it sometime.

If you do, you will notice some errors I made. Not having much practice, I
found checking the RTF pretty hard, because you can't easily see what is
manual formatting and what is formatting through styles. Often the same
formatting information is even present in different versions (to keep backward
compatibility with older versions of RTF/Word). So at first I thought Word
puts some overrides/re-starts in the file even when the numbering is done with
styles; now I think those overrides/re-starts are only encountered via the
style definition/list template and therefore are very different from re-starts
you apply manually.


It was a bit presumtuous of me to say "this is the way Word's numbering must
have been meant to work" as long as it's not clear what constitutes a design
decision and what a design error ;-)

As an example, let me return to something mentioned in my first posting (and
addressed in your first reply):

Numbering done with styles and lists (templates) linked to the styles is very
robust and stable, but (not counting work-arounds) you only can restart the
numbering either with manual formatting in Word2000 (the restart "resides" in
the paragraph you apply it to) or by applying a different list (template),
which will fudge up your numbering if you copy/paste between "different" lists.

In most documents lists consist of contiguous list paragraphs numbered
sequentially, and there are non-list paragraphs between different lists
(headings, body text, ...). So a mechanism to restart list numbering each time
a non-list paragraph is encountered would be good enough for most lists.

In outline numbered lists, most times you have for example list level 2
paragraphs re-start numbering after list level 1 paragraphs (1 1a. 1b. ... 2
2a. ...).

You achieve that in the list template by setting ".ResetOnHigher" for that
list level, where .ResetOnHigher must be a number lower than the list level.
In list level 4, ".ResetOnHigher=2" means that the list level 4 numbering is
restarted each time a paragraph with list level 2 is encountered.

Since all non-numbered paragraphs (styles) return "0" as their
ListLevelNumber, it should have been easy to re-start a list each time some
non-list paragraph appears.

But "ResetOnHigher=0" *doesn't* work as "reset on list level 0". Instead it is
interpreted as "ResetOnHigher=False". That is *very* bad design in my opinion
to make a parameter work differently for some magic number. And it makes it
impossible to implement lists that automatically re-start when a non-list
paragraph is between them. IMO this is one of the biggest design errors in numbering.

Because of this design error, there is no simple way to re-start through the
list template definition, you *have to* use manual re-starts to restart list
numbering (with all draw-backs of manual formatting, and the additional
pasting bug), or fix the numbering with macros (as you seem to do), or use
work-arounds like the "Dummy Restart"-method (which, as far as I understood
it, doesn't set ContinuePreviousList to False in the paragraph, but sets
ResetOnHigher=1 in the list template, with some dummy restart style of list
level 1 (that doesn't have any numbering).


Cindy Meister wrote:
> When you copy/paste lists there [in Word2002], you have a choice

> whether to continue or restart numbering (and this does generate
> a new list). The addition of LIST STYLES also helps keep numbering
> "straightened out".

Sounds as if a different list table is used for every restarted list, and the
user has to fix the numbering when pasting between "different" lists by
choosing "continue". The idea of having dozens of copies of the list table
around in the file, one for each re-start, wouldn't be too nice either, and
re-applying your list style to a paragraph would still fudge up your numbering
(since there can be only one list template linked to your styles) ... -- but
my suspicions may well be unfounded.


> Generally, John McGhie and I came to the conclusion that if one uses
> the new interfaces, and NEVER touches Format/Bullets and Numbering/Outline
> numbered, things are pretty stable.

John McGhie wrote:
> With the roll-out of Word 2002, I think more and more people
> are going to need to understand this mechanism, because that's now it works.

[scratching my head] Well, that *would* be nice :-)


Regards, Klaus

Klaus Linke

unread,
Aug 4, 2001, 4:08:01 AM8/4/01
to
Hi John,

I don't know if RTF gives you a good picture as to how things are handled in
Word (for example whether there *is* such a thing as a "list override table"
in memory when you open a document), and since I don't know much about RTF,
you should take my "analysis" in the previous posts with a grain of salt. I
only look at the RTF (and the RTF spec) as a last resort, when I have no idea
how something in Word is done.

> I think (actually, I "know", through discussions with someone
> who worked on the code...)

I hope you spared his life ;-) They really don't have an easy job. It's my
guess that the bugs (not the design errors) in numbering should have been easy


to fix in a service pack, but they didn't because applying the fixes would
have changed the numbering in existing documents.

> 3) Lawyers wanted the formatting of the numbering to determine the
> formatting of the paragraph. And that's where the rot set in.
> This last use case is what has created the circular references between
> the two mechanisms that pulls the whole damned thing unstuck.

Lawyers like to make simple things complicated ... excuses to
Charles Kenyon: there are exceptions :-)


> [...] and I will go carefully through it sometime.

If you do, you will notice some errors I made. Not having much practice, I
found checking the RTF pretty hard, because you can't easily see what is
manual formatting and what is formatting through styles. Often the same
formatting information is even present in different versions (to keep backward
compatibility with older versions of RTF/Word). So at first I thought Word
puts some overrides/re-starts in the file even when the numbering is done with
styles; now I think those overrides/re-starts are only encountered via the
style definition/list template and therefore are very different from re-starts
you apply manually.


It was a bit presumtuous of me to say "this is the way Word's numbering must
have been meant to work" as long as it's not clear what constitutes a design
decision and what a design error ;-)

As an example, let me return to something mentioned in my first posting (and
addressed in your first reply):

>> It would have been nice if you had the choice to restart numbering every
>> time a paragraph without numbering is inserted. As far as I can see,

>> somebody at Microsoft ruined that by interpreting ".ResetOnHigher=0" to
>> mean ".ResetOnHigher=False" instead of interpreting "0" as the numbering
>> level.

> Set ContinuePreviousList to False and the numbering will reset at
> that point. That's how Dave's button works too, I think.

Numbering done with styles and lists (templates) linked to the styles is very


robust and stable, but (not counting work-arounds) you only can restart the
numbering either with manual formatting in Word2000 (the restart "resides" in

the paragraph you apply it to) or by applying a different list, which will

John McGhie wrote:
> With the roll-out of Word 2002, I think more and more people
> are going to need to understand this mechanism, because that's now it works.

[scratching my head] Well, that *would* be nice :-)


Regards, Klaus

Dave Rado

unread,
Aug 15, 2001, 5:08:24 AM8/15/01
to
For the benefit of anyone using Word 97 ...

| ~~~~~~~~~
| Since there may be only a maximum of 2000 entries in the override table
| according to the RTF1.6-specs, I guess this should be responsible for much
| document corruption.
| ~~~~~~~~~
| Word 2000 has a fix for this - see
| http://support.microsoft.com/directory/article.asp?id=KB;EN-US;Q241581
| Doesn't help if you email an about-to-become-corrupt document to someone
who
| hasn't applied the fix though.
| ~~~~~~~~~

Provided you have installed the so-called Word 97 "Leap Year Patch", Word 97
also has a fix for this:
http://support.microsoft.com/directory/article.asp?id=KB;EN-US;Q237274

In fact, the "Leap Year Patch" fixed a large number of list numbering bugs,
and from my experiments it would seem to me that, provided you have
installed it, (and made the registry change covered in the above KB
article), Word 97 and Word 200 have equally stable (or unstable, depending
on your point of view <g>) numbering.

Regards

Dave


0 new messages