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

Nightmare on ListNumbering Street

167 views
Skip to first unread message

Dave Rado

unread,
Feb 7, 2000, 3:00:00 AM2/7/00
to
Hi all

Some of my templates have heading styles that have no numbering by default,
but with a toolbar button that applies list numbering to the headings when
required.

On John Nurick's advice, the macro gives the list template it creates a
name. So the basic code looks like this:-

Set MyList = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True)
With MyList.ListLevels(1)
loads of stuff ...
.LinkedStyle = "Heading 1"
End With
With MyList.ListLevels(2)
loads more stuff ...
.LinkedStyle = "Heading 2"
End With
and so on ...until ...
MyList.Name = "HeadingTemplate"

********

I also have several templates where the Headings *are* numbered by default.
Again, on John's advice, I didn't define the numbering in Word, instead I
opened the dot files and ran the above code in the templates, as a one-off,
then saved the templates.

********

My macro finds out whether or not the "HeadingTemplate" ListTemplate already
exists in the active document as follows - this isn't my main query but the
following is probably *not* the neatest way of doing it(!), so I thought I'd
post it in case anyone can suggest a better way:-

On Error Resume Next
TempStr = ActiveDocument.ListTemplates("HeadingTemplate").Creator
If Err.Number = 0 Then
'The "HeadingTemplate" ListTemplate already exists
End If

********

If I create a new document that *doesn't* have its headings numbered by
default, and then paste some text (including some headings) into it from
another document.in which the headings *are* numbered, then:-

1) The headings come in initially un-numbered (which is good).


2) The "HeadingTemplate" ListTemplate now exists in the new document, even
though it is not applied to the headings (not good, IMO).


3) If I then want the headings in the new document to be numbered, if I run
the following line it only applies numbering to the Heading 1 style - it
leaves Headings 2+ un-numbered (the nightmare I was referring to):-

ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
ActiveDocument.ListTemplates("HeadingTemplate"), ListLevelNumber:=1


4) If instead of the above I run the following, it works (in the sense that
all heading levels are numbered) - but I don't want to use the ListGalleries
collection - apart from eanything else, the index is much too
unpredictable:-

ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates(5), ListLevelNumber:=1


5) If instead of 3), I run the following, Word crashes:-

For Counter = 1 To 9
TempStr = "Heading " & Counter
ActiveDocument.Styles(TempStr).LinkToListTemplate ListTemplate:= _
ActiveDocument.ListTemplates("HeadingTemplate"), _
ListLevelNumber:=Counter
Next Counter


6) If instead of 3), I run the following, I get a "The requested menber of
the collection does not exist" message" - so although pasting the numbered
headings in ahs added the "HeadingTemplate" ListTemplate to the
ActiveDocument.ListTemplates collection, it appears not to have added it to
the ListGalleries(wdOutlineNumberGallery).ListTemplates collection:-

ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
ListGalleries(wdOutlineNumberGallery).ListTemplates("HeadingTemplate"),
ListLevelNumber:=1


I can't even delete the "HeadingTemplate" List Template and add it again, as
far as I can make out - and I don't want to create a new List Template with
a different name if the "HeadingTemplate" List Template happens to exist
already - I can imagine ending up creating 10,000 separate list templates
per document if I went down that route ....

HELP!

Regards

Dave

John Nurick

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
On Mon, 7 Feb 2000 21:06:25 -0000, "Dave Rado"
<dave...@contactbox.co.uk> wrote:

<snip>

>My macro finds out whether or not the "HeadingTemplate" ListTemplate already
>exists in the active document as follows - this isn't my main query but the
>following is probably *not* the neatest way of doing it(!), so I thought I'd
>post it in case anyone can suggest a better way:-
>
>On Error Resume Next
>TempStr = ActiveDocument.ListTemplates("HeadingTemplate").Creator
>If Err.Number = 0 Then
> 'The "HeadingTemplate" ListTemplate already exists
>End If

I iterate through the collection to see if it's there; I hate VB error
handling so much that I (perhaps irrationally) don't throw deliberate
exceptions if I can find another way round! If the listtemplate
exists, I set its properties to what htey should by; if it doesn't
exist i create it and then set the properties.


>5) If instead of 3), I run the following, Word crashes:-
>
>For Counter = 1 To 9
> TempStr = "Heading " & Counter
> ActiveDocument.Styles(TempStr).LinkToListTemplate ListTemplate:= _
> ActiveDocument.ListTemplates("HeadingTemplate"), _
> ListLevelNumber:=Counter
>Next Counter
>

It's too late at night for me to start reading my own code (I have
been fighting my way through an Excel 97 bug involving array formulas
that sent a rock solid macro spiralling in flames). But I'm certain
I've had the exact same crash. Try iterating from 9 down to 1 instead
of from 1 to 9. I know it makes no difference in real programming, but
this is Microsoft. Also, you can IIRC get the heading styles with
constants so as not to have to concatenate "heading " & number, which
is handy if you're tyring to delocalise the code.

This code also lets you switch the headings styles from numbered to
unnumbered, or change the formatting, simply by attaching them to the
right listtemplate.


--
John

Please reply to the newsgroup and not by e-mail. That way, more
brain cells get to work on the problem!

John McGhie [MVP - Word]

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Dave:

Ahhhh..... didn't take us long to get you frothing at the mouth, now did it
:-)

In microsoft.public.word.numbering on Mon, 7 Feb 2000 21:06:25 -0000, "Dave
Rado" <dave...@contactbox.co.uk> wrote:

> Some of my templates have heading styles that have no numbering by default,
> but with a toolbar button that applies list numbering to the headings when
> required.
>

> 3) If I then want the headings in the new document to be numbered, if I run
> the following line it only applies numbering to the Heading 1 style - it
> leaves Headings 2+ un-numbered (the nightmare I was referring to):-
>
> ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
> ActiveDocument.ListTemplates("HeadingTemplate"), ListLevelNumber:=1
>
>
> 4) If instead of the above I run the following, it works (in the sense that
> all heading levels are numbered) - but I don't want to use the ListGalleries
> collection - apart from eanything else, the index is much too
> unpredictable:-
>
> ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
> ListGalleries(wdOutlineNumberGallery).ListTemplates(5), ListLevelNumber:=1

Months of fruitless poring over the VBA help has taught me that some
operations, and particularly APPLY operations, work properly ONLY through
the List Galleries collection.

I have managed to persuade my users (I'm very big...) to sacrifice three or
four of their List Gallery positions to "Company Standard Numbering Styles".
I use positions 1, 2, 3 and sometimes 4. (Word overwrites from the far end,
so the early positions are more stable). I use a macro to set them up for
the user, and to put them right when they go wrong.

I have found that used that way, Word's Heading numbering is sufficiently
stable to be useable. Just.

But it is so riddled with bugs that if you attempt anything clever it will
blow up in your face.

Have you had a look at the ListNum field? :-)


>
>
> 5) If instead of 3), I run the following, Word crashes:-
>
> For Counter = 1 To 9
> TempStr = "Heading " & Counter
> ActiveDocument.Styles(TempStr).LinkToListTemplate ListTemplate:= _
> ActiveDocument.ListTemplates("HeadingTemplate"), _
> ListLevelNumber:=Counter
> Next Counter

Yeah, that would crash. You need to set all nine operations up in a single
operation. HeadingTemplate contains nine levels: you can't set nine levels
onto each of nine styles: you need to set nine styles onto one List
Template. Just don't ask me to explain that.... Record a macro from the
Format/Style/Bullets and Numbering dialog and watch how Word does it.



> 6) If instead of 3), I run the following, I get a "The requested menber of
> the collection does not exist" message" - so although pasting the numbered
> headings in ahs added the "HeadingTemplate" ListTemplate to the
> ActiveDocument.ListTemplates collection, it appears not to have added it to
> the ListGalleries(wdOutlineNumberGallery).ListTemplates collection:-

That's right, it hasn't :-) You need to explicitly add a list template to
the list gallery :-) But you can't, since the collection only knows about
seven, so you have to overwrite one :-)

> ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
> ListGalleries(wdOutlineNumberGallery).ListTemplates("HeadingTemplate"),
> ListLevelNumber:=1
>
>
> I can't even delete the "HeadingTemplate" List Template and add it again, as
> far as I can make out -

I don't know why that is, but I suspect that Word is accessing the gallery
as a bit-map (i.e. that it can access only positions 0-7 in each of three
bytes) and not using the name as an index. Surely they wouldn't have coded
it so that it accesses as a bit-map for write operations and as a string for
read operations. They wouldn't... Would they???

> and I don't want to create a new List Template with
> a different name if the "HeadingTemplate" List Template happens to exist
> already - I can imagine ending up creating 10,000 separate list templates
> per document if I went down that route ....

Yep. We did, and that's what happened :-)

> HELP!

Observe the following carefully:

1) It doesn't work.

2) It's never going to be reliable.

3) There is no cure.

4) You cannot rely on Word list numbering for professional work.

Now, come back when you admit your powerlessness over Word numbering and we
will show you how to do stable, reliable numbering with SEQ fields and
ListNum fields, and how to set up "Masher Macros" to hammer users' List
Gallery into shape for use with low-value documents.

Oh, and have one of my little yellow pills... they work quite well, and the
men in the white coats are really very nice...

Cheers.

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

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

Dave Rado

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Thanks John and John

Regards

Dave

Dave Rado <dave...@contactbox.co.uk> wrote in message
news:u8iQ##ac$GA.204@cppssbbsa04...
| Hi all


|
| Some of my templates have heading styles that have no numbering by
default,
| but with a toolbar button that applies list numbering to the headings when
| required.
|

| On John Nurick's advice, the macro gives the list template it creates a
| name. So the basic code looks like this:-
|
| Set MyList = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True)
| With MyList.ListLevels(1)
| loads of stuff ...
| .LinkedStyle = "Heading 1"
| End With
| With MyList.ListLevels(2)
| loads more stuff ...
| .LinkedStyle = "Heading 2"
| End With
| and so on ...until ...
| MyList.Name = "HeadingTemplate"
|
| ********
|
| I also have several templates where the Headings *are* numbered by
default.
| Again, on John's advice, I didn't define the numbering in Word, instead I
| opened the dot files and ran the above code in the templates, as a
one-off,
| then saved the templates.
|
| ********
|

| My macro finds out whether or not the "HeadingTemplate" ListTemplate
already
| exists in the active document as follows - this isn't my main query but
the
| following is probably *not* the neatest way of doing it(!), so I thought
I'd
| post it in case anyone can suggest a better way:-
|
| On Error Resume Next
| TempStr = ActiveDocument.ListTemplates("HeadingTemplate").Creator
| If Err.Number = 0 Then
| 'The "HeadingTemplate" ListTemplate already exists
| End If
|

| ********
|
| If I create a new document that *doesn't* have its headings numbered by
| default, and then paste some text (including some headings) into it from
| another document.in which the headings *are* numbered, then:-
|
| 1) The headings come in initially un-numbered (which is good).
|
|
| 2) The "HeadingTemplate" ListTemplate now exists in the new document, even
| though it is not applied to the headings (not good, IMO).
|
|

| 3) If I then want the headings in the new document to be numbered, if I
run
| the following line it only applies numbering to the Heading 1 style - it
| leaves Headings 2+ un-numbered (the nightmare I was referring to):-
|
| ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
| ActiveDocument.ListTemplates("HeadingTemplate"), ListLevelNumber:=1
|
|
| 4) If instead of the above I run the following, it works (in the sense
that
| all heading levels are numbered) - but I don't want to use the
ListGalleries
| collection - apart from eanything else, the index is much too
| unpredictable:-
|
| ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
| ListGalleries(wdOutlineNumberGallery).ListTemplates(5),
ListLevelNumber:=1
|
|

| 5) If instead of 3), I run the following, Word crashes:-
|
| For Counter = 1 To 9
| TempStr = "Heading " & Counter
| ActiveDocument.Styles(TempStr).LinkToListTemplate ListTemplate:= _
| ActiveDocument.ListTemplates("HeadingTemplate"), _
| ListLevelNumber:=Counter
| Next Counter
|
|

| 6) If instead of 3), I run the following, I get a "The requested menber of
| the collection does not exist" message" - so although pasting the numbered
| headings in ahs added the "HeadingTemplate" ListTemplate to the
| ActiveDocument.ListTemplates collection, it appears not to have added it
to
| the ListGalleries(wdOutlineNumberGallery).ListTemplates collection:-
|

| ActiveDocument.Styles("Heading 1").LinkToListTemplate ListTemplate:= _
|
ListGalleries(wdOutlineNumberGallery).ListTemplates("HeadingTemplate"),
| ListLevelNumber:=1
|
|
| I can't even delete the "HeadingTemplate" List Template and add it again,
as

| far as I can make out - and I don't want to create a new List Template


with
| a different name if the "HeadingTemplate" List Template happens to exist
| already - I can imagine ending up creating 10,000 separate list templates
| per document if I went down that route ....
|

| HELP!
|
| Regards
|
| Dave
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Margaret Aldis

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Hi Dave - and both Johns -

For what it's worth (I am no programmer!), this is how I use
ListTemplate objects. I avoid the ListGallery because my experience
(admittedly back in SR1) days was that copying numbered styles (and
styled paragraphs) and updating from template would 'lose the link'
between the correct list format and the style when the style was linked
to a list template via the ListGalleries collection, but kept its
linking when linked to a newly added ListTemplate. Later stuff from John
Nurick and Bill Coan on template naming added the essential ingredient
to avoid building up unwanted list templates (though to be fair, even
documents with hundreds of list templates didn't seem to cause problems,
and manipulating the styles, not the templates, kept things in order for
me).

When applying numbering, I first test whether the named List Template
exists by iterating through the ListTemplates collection:

' See if the list template already exists and create if not
Dim aListTemplate As ListTemplate
Exists = False
For Each aListTemplate In ActiveDocument.ListTemplates
If LCase$(aListTemplate.Name) = LCase$("HeadingList") Then
Exists = True
End If
Next aListTemplate
If Exists = False Then
Set newlist = ActiveDocument.ListTemplates.Add_
(OutlineNumbered:=True, Name:="HeadingList")
End If

Then I use the name (which, despite the ambiguous VBA Help, John N
showed does work as an index to the ListTemplates collection) to do all
the linking:

'Set up the list format and style linking
With ActiveDocument.ListTemplates("HeadingList").ListLevels(1)
.NumberFormat = "%1"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(-2)
.Alignment = wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(0)
.TabPosition = CentimetersToPoints(0)
.ResetOnHigher = True
.StartAt = 1


.LinkedStyle = "Heading 1"
End With

And so on down the levels. This code seems to work fine for both new and
previously existing ListTemplates, and doesn't seem to create any extra
list templates.

To unnumber, I use the .LinkToListTemplate method 9linking to None) on
each heading level in turn - I don't try to do anything fancy with a
loop, just have 9 similar lines, one for each Heading style.

Regards

Margaret

In article <u8iQ##ac$GA.204@cppssbbsa04>, Dave Rado
<dave...@contactbox.co.uk> writes

--

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

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

Dave Rado

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
H Margaret

Thanks

Regards

Dave

Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message
news:lKwqKGAy3$n4I...@syntagma.demon.co.uk...

Bill Coan

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
> Then I use the name (which, despite the ambiguous VBA Help, John N
> showed does work as an index to the ListTemplates collection) to do all
> the linking:

In my opinion, the Help file discourages the use of the name property as an
index to the collection for the simple reason that, every time you apply a
list template, Word actually creates a new one and appends a "2" to the
name.

So, for example, if you have a list template called myList and you apply
this list template to a selection, the selection actually gets a new list
template called myList2. The next time you apply the list template, the
selection gets a new list template called myList22. And so on. When the name
of the list template reaches 255 characters, Word crashes!

That's why, when you record an operation involving the Format Bullets and
Numbering dialog box, you'll notice that the list template name is set to
and empty string ("") immediately before the list template is applied.

As if we needed another wrinkle, eh?

--
Bill Coan
Microsoft Word MVP
Neenah WI 54956 USA
http://www.wordmacros.com
. . .


Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message
news:lKwqKGAy3$n4I...@syntagma.demon.co.uk...

Margaret Aldis

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Thanks for this, Bill. I knew about the appended number from your
exchange with John N a while ago, but certainly hadn't actually thought
it through to this conclusion!

However, I think using the name is 'safe' in this case, because I don't
ever apply List Templates directly (by name or otherwise) - I only use
the name to avoid creating extra List Templates when setting up styles
to be numbered. All numbering is applied via the styles, and I don't
allow direct restarting of lists from the B&N dialog (in fact, I don't
give access to the B&N dialog at all <g>)

Regards

Margaret


In article <uWrU91jc$GA....@cppssbbsa02.microsoft.com>, Bill Coan
<bill...@wordmacros.com> writes

Dave Rado

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Margaret Aldis <Marg...@nospam.demon.co.uk> wrote

| (in fact, I don't
| give access to the B&N dialog at all <g>)

You're brave!

Regards

Dave

Bill Coan

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Hi Margaret,

I agree, your approach seems fine. It's the same one I use.

--
Bill Coan
Microsoft Word MVP
Neenah WI 54956 USA
http://www.wordmacros.com
. . .
Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message

news:PmTgxCAD...@syntagma.demon.co.uk...

Dave Rado

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Hi Bill and Margaret

I'm using the same approach for headings and it seems to be working now, so
nany thanks. I'm trying to get my head around how you would use that
approach to apply outline numbering to body text. Do you use styles there
too? If so how do you go about it?

Regards

Dave

Bill Coan <bill...@wordmacros.com> wrote in message
news:e7jIHOnc$GA....@cppssbbsa02.microsoft.com...

Bill Coan

unread,
Feb 8, 2000, 3:00:00 AM2/8/00
to
Hi Dave,

I'll defer to Margaret and to John on this one. The fact is, none of my
clients rely on automatic numbering other than heading numbering. I've
investigated it for my own satisfaction numerous times but not lately and my
stack is rather short so numbering got pushed off of it quite a while ago.

--
Bill Coan
Microsoft Word MVP
Neenah WI 54956 USA
http://www.wordmacros.com
. . .

Dave Rado <dave...@contactbox.co.uk> wrote in message

news:#f6H$nnc$GA.292@cppssbbsa05...

John Nurick

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
On Tue, 8 Feb 2000 15:32:19 +0000, Margaret Aldis
<Marg...@nospam.demon.co.uk> wrote:

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

Margaret, I adore your sig - but have recently been thinking about
cavalry charges in battle. Does the Whitehead passage continue along
the lines:

"Moreover, they often go much further than intended - and seldom in
the direction intended.

John Nurick

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
On Tue, 8 Feb 2000 15:32:19 +0000, Margaret Aldis
<Marg...@nospam.demon.co.uk> wrote:

>Thanks for this, Bill. I knew about the appended number from your
>exchange with John N a while ago, but certainly hadn't actually thought
>it through to this conclusion!
>
>However, I think using the name is 'safe' in this case, because I don't
>ever apply List Templates directly (by name or otherwise) - I only use
>the name to avoid creating extra List Templates when setting up styles
>to be numbered. All numbering is applied via the styles, and I don't
>allow direct restarting of lists from the B&N dialog (in fact, I don't
>give access to the B&N dialog at all <g>)

It's almost the same a few counties east. I'm not brave enough (yet)
to use Word's list numbering for numbered lists, only for heading
numbering and bulleted paragraphs. It's months (touch wood) since
anyone brought me a heading numbering problem in a document attached
to one of our templates, which means that either it's working
perfectly (impossible) or the toolkit macros that either link or
unlink the list levels from the heading sthyles are doing their job
(hoorah!).

These macros, BTW, invoke the listtemplates by name but don't seem to
generate extra LTs with ever-lengthening names. I think this only
happens when you are applying a named LT directly to a selection (or
range?).

The templates hide the B&N dialog behind (1) a More... button on the
custom B&N userform and (2) an intimidating messagebox along the lines
of "Are you really sure you know what you are doing?". (The firm
depends on the intelligence and commonsense of its employees in a
million other ways, so why not in this?)

Margaret Aldis

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
In article <oc31asclaeli2av09...@4ax.com>, John Nurick
<j.nu...@dial.pipex.com> writes

>On Tue, 8 Feb 2000 15:32:19 +0000, Margaret Aldis
><Marg...@nospam.demon.co.uk> wrote:
>
>>"Civilisation advances by extending the number of important
>>operations which we can perform without thinking about them.
>>Operations of thought are like cavalry charges in battle - they are
>>strictly limited in number, they require fresh horses, and must
>>only be made at decisive moments." A N Whitehead
>
>Margaret, I adore your sig - but have recently been thinking about
>cavalry charges in battle. Does the Whitehead passage continue along
>the lines:
>
>"Moreover, they often go much further than intended - and seldom in
>the direction intended.
>

LOL! Even more pertinent than I thought!

Margaret Aldis

unread,
Feb 9, 2000, 3:00:00 AM2/9/00
to
Hi All -

Yes, I do use the strict style-named list template approach for list
numbering too - in fact, I feel it is even more important here as it
seems to be the only way to avoid (classic) spaghetti numbering caused
by cutting/copying and pasting items between list objects - something
which you do a thousand times if you are editing user
manuals/Help/procedures containing numbered steps!

The approach I use is to link the top level of an outline list to a
'dummy' style, which prints small and white. the first level numbered
lists is linked to Level 2 of the outline list, and so on. This allows
all lists within the document to be one List Object (which is what
happens if you apply numbering via style and don't use Restart
numbering). I have a macro called 'Start list' which both makes the
current para a List Number style and inserts the dummy paragraph before
it (it has to have some text in it, and it can't be hidden, or it
doesn't restart the numbering of lower levels). So to start a list, you
click this button. (I also have a macro that will go back and take the
last one of these out.)

My first try at this I linked Body Text to the top level (no number
printed, obviously) which was great for automatically 'doing what was
sensible' but doesn't work well with revision marking. Also you still
need a dummy para for those occasions when you have two lists separated
by a heading only.

I've been using this approach for a while now and it seems to work fine.
But it's about to be rolled out to a much wider audience so the
usability will get a bit more of a hammering - I'll report back!

Cheers

Margaret

In article <eaJgu9nc$GA.283@cppssbbsa04>, Bill Coan

Dave Rado

unread,
Feb 10, 2000, 3:00:00 AM2/10/00
to
Hi Margaret

An ingenious strategy; but I'm still struggling to get my head around some
of its practical implications:-

1) If you apply paragraph styles when the user clicks on your listnumbeing
button, then you must be setting the space between paras via the style. But
IMO the appropriate space between paras depends on the context - a series of
numbered one liners typically look best with a space between of just under
half the font size, whereas a series of numbered full-length paragraphs
usually look better with a space between equal to the point size - how does
your button provide that flexibility? Do you have 2 sets of styles? Or
(shock horror!) do you have to adjust the spacing manually after the event?

2) What does your macro do when the user toggles numbering off for a
selection? Revert the selection to the body text style? Check the para
above the selection and delete it if it's a dummy (level 1) para? What if
the selection *shouldn't* revert to body text but to some other style - e.g.
if the user had numbered the left column of a table, and then toggled the
numbering off again, in which case it should toggle back to one of your
table styles (but which one? Depends on the table format ...)

3) What happens if the user pastes a numbered list from another document
in which the numbering was created the "Microsoft" (pasta-based) way, into
the middle of one of your lists?

I imagine you've used your own style names and haven't redefined the
built-in "List Number" styles (because if you've used the built-in ones, and
if the document you were pasting from used the List Number style, it would
come in as your dummy list level 1 paras, and I don't know about your users
but mine would panic!).

But does your macro recognise that there's a foreigner in its midst, and
apply your list level 2 style to the foreign bits, and realise it shouldn't
bother inserting the dummy list level 1 para if the foreign list is in the
middle of a kosher one? If so, does the user have to select the whole list
for this to work, or do they have to select the whole of the non-kosher bit,
or just click in any para in the non-kosher bit, or where do they have to
click before running your macro, in order for the list to be "made kosher"?
(All these food analogies are making me hungry)!

4) How do you get round the problem that if the user hits Return twice, the
numbering is removed from the new para but the style remains a list style?

All in all, as a simple StartListHere macro I can see how it could work, but
as something sophisticated enough to replace Format Bullets and Numbering,
I'm struggling with the implications. But I must admit I find the prospect
of successfully jinxing Microsoft's best efforts to make reliable numbering
impossible - and without having to resort to fields - a very enticing one;
and if you have the patience to teach me, I think you'll find I make an
appreciative pupil!

Regards

Dave

Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message

news:bBfV4BAw...@syntagma.demon.co.uk...

John Nurick

unread,
Feb 11, 2000, 3:00:00 AM2/11/00
to
On Thu, 10 Feb 2000 22:02:49 -0000, "Dave Rado"
<dave...@contactbox.co.uk> wrote:

>An ingenious strategy; but I'm still struggling to get my head around some
>of its practical implications:-
>
>1) If you apply paragraph styles when the user clicks on your listnumbeing
>button, then you must be setting the space between paras via the style. But
>IMO the appropriate space between paras depends on the context - a series of
>numbered one liners typically look best with a space between of just under
>half the font size, whereas a series of numbered full-length paragraphs
>usually look better with a space between equal to the point size - how does
>your button provide that flexibility? Do you have 2 sets of styles? Or
>(shock horror!) do you have to adjust the spacing manually after the event?

Since Word doesn't give you context-sensitive style definitions, to do
this you have the choice of (a) having paragraphs with the same style
name but different directly applied formatting, or (b) use different
styles. I reckon that (a) is worse than (b).

>2) What does your macro do when the user toggles numbering off for a
>selection? Revert the selection to the body text style? Check the para
>above the selection and delete it if it's a dummy (level 1) para? What if
>the selection *shouldn't* revert to body text but to some other style - e.g.
>if the user had numbered the left column of a table, and then toggled the
>numbering off again, in which case it should toggle back to one of your
>table styles (but which one? Depends on the table format ...)

Can't answer for Margaret, but my users have learnt that the "remove
numbering" macro usually needs to be followed by applying the right
style for the new circumstances. (I don't use Margaret's technique
with dummy level 1 pars, but shall consider it next time there's a
major template upgrade.)

>3) What happens if the user pastes a numbered list from another document
>in which the numbering was created the "Microsoft" (pasta-based) way, into
>the middle of one of your lists?

For my users: if the numbering looks wrong, they select the list, run
the Remove Numbering macro and then re-apply the correct kind of
numbering.

[snip]

John McGhie [MVP - Word]

unread,
Feb 11, 2000, 3:00:00 AM2/11/00
to
Dave:

I'm not Margaret :-) Margaret's developing something very good, and I shall
be reading her answer with interest. But this is what I do in corporate
workgroup situations:

In microsoft.public.word.numbering on Thu, 10 Feb 2000 22:02:49 -0000, "Dave
Rado" <dave...@contactbox.co.uk> wrote:

> 1) If you apply paragraph styles when the user clicks on your listnumbeing
> button, then you must be setting the space between paras via the style.

I should hope so :-)

> Do you have 2 sets of styles?

I have at least three, with toolbar buttons that apply them.

> 2) What does your macro do when the user toggles numbering off for a
> selection?

They can't: They apply a different style and the numbering goes away, or
they use the Skip Numbering command that you need to resurrect and place on
their context menus.

> Revert the selection to the body text style? Check the para
> above the selection and delete it if it's a dummy (level 1) para?

I prefer to use the "Continue previous list" button on the rare occasions
when I need it, rather than using Margaret's dummy paragraph. The problem
with "magic paragraphs" is that normal users will not realise they are in
the document and trash them. Magic Paragraphs (paragraphs that do special
things such as reset numbering) are a great solution for a single,
highly-competent author or small highly-trained workgroup. They tend to
come messily unravelled in a large workgroup of corporate users.

> the selection *shouldn't* revert to body text but to some other style - e.g.
> if the user had numbered the left column of a table, and then toggled the
> numbering off again, in which case it should toggle back to one of your
> table styles (but which one? Depends on the table format ...)

Dave, you can't (practicably...) make these buttons "toggles". Just put
buttons on your toolbar for all the styles the user wants and get rid of the
crap they now don't need. The user won't "toggle" the numbering, they will
simply apply a "different" style. I take about 14 of 16 buttons off the
formatting toolbar and put all the styles I do need up there.



> 3) What happens if the user pastes a numbered list from another document
> in which the numbering was created the "Microsoft" (pasta-based) way, into
> the middle of one of your lists?

If both documents came from the same template (i.e. had the same definitions
for the same numbered styles) it will be OK. If the numbered styles are
defined to different list templates, ... pasta surprise :-)



> I imagine you've used your own style names and haven't redefined the
> built-in "List Number" styles (because if you've used the built-in ones, and
> if the document you were pasting from used the List Number style, it would
> come in as your dummy list level 1 paras, and I don't know about your users
> but mine would panic!).

I do not define my own style names, I customise List Number 1 through 9. I
find that those styles seem to have "magic" properties of their own that
make the result more stable.

Note: You MUST disable "Automatically update document styles" on the attach
template dialog if you are going to define numbering in the styles.
Otherwise your numbering will blow up on document open.

> 4) How do you get round the problem that if the user hits Return twice, the
> numbering is removed from the new para but the style remains a list style?

You don't get around that. That's advertised behaviour, users expect it.
We quickly learn not to hit return twice :-)

> All in all, as a simple StartListHere macro I can see how it could work, but
> as something sophisticated enough to replace Format Bullets and Numbering,
> I'm struggling with the implications.

What *I* struggled with was a macro that picked up the list format from the
current paragraph using VBA, and replaced it with the "ContinuePreviousList
property set to False. But it blew up in my face and I didn't have the time
to chase it. I think where I went wrong was that I did not check the
"CanContinuePreviousList" flag first and probably tried to continue one that
couldn't.

Just my thoughts

Margaret Aldis

unread,
Feb 11, 2000, 3:00:00 AM2/11/00
to
Hi Dave - I'll do my best to answer your questions:

In article <OsQYiLBd$GA.62@cppssbbsa04>, Dave Rado
<dave...@contactbox.co.uk> writes
>Hi Margaret


>
>An ingenious strategy; but I'm still struggling to get my head around some
>of its practical implications:-
>

>1) If you apply paragraph styles when the user clicks on your listnumbeing

>button, then you must be setting the space between paras via the style. But
>IMO the appropriate space between paras depends on the context - a series of
>numbered one liners typically look best with a space between of just under
>half the font size, whereas a series of numbered full-length paragraphs
>usually look better with a space between equal to the point size - how does
>your button provide that flexibility? Do you have 2 sets of styles? Or
>(shock horror!) do you have to adjust the spacing manually after the event?

I only have one set of numbered list styles as this is a simple 'block
paragraph' design (heck, if we're into 'proper' typographic design what
are we doing with Word!), but if I needed different formats then I would
use different styles - the basis for fighting on down this path at all
has always been an attempt to stick strictly to styles in order to allow
'big document' text reformatting and 'pouring' from one doc or page
design to another - recreating the certainties of working in FrameMaker
(sigh).

>
>2) What does your macro do when the user toggles numbering off for a

>selection? Revert the selection to the body text style? Check the para
>above the selection and delete it if it's a dummy (level 1) para? What if


>the selection *shouldn't* revert to body text but to some other style - e.g.
>if the user had numbered the left column of a table, and then toggled the
>numbering off again, in which case it should toggle back to one of your
>table styles (but which one? Depends on the table format ...)

You're still thinking direct numbering here; there is no 'toggle off'
button in this set-up. The follow-on style is another para of the same
type. If they don't want another list item at that level, then the user
can choose any style they want - the most common ones (all on toolbar
buttons) are an indented para (for a follow on para within the list
item), or Body Text to carry on with normal text.

>3) What happens if the user pastes a numbered list from another document
>in which the numbering was created the "Microsoft" (pasta-based) way, into
>the middle of one of your lists?
>

>I imagine you've used your own style names and haven't redefined the
>built-in "List Number" styles (because if you've used the built-in ones, and
>if the document you were pasting from used the List Number style, it would
>come in as your dummy list level 1 paras, and I don't know about your users
>but mine would panic!).
>

>But does your macro recognise that there's a foreigner in its midst, and
>apply your list level 2 style to the foreign bits, and realise it shouldn't
>bother inserting the dummy list level 1 para if the foreign list is in the
>middle of a kosher one? If so, does the user have to select the whole list
>for this to work, or do they have to select the whole of the non-kosher bit,
>or just click in any para in the non-kosher bit, or where do they have to
>click before running your macro, in order for the list to be "made kosher"?
>(All these food analogies are making me hungry)!

I use the built-in style names for semantic equivalents (i.e. List
Number is the first level numbered list item, linked to level two in the
outline list ListTemplate; level 1 is linked to a special style). If you
paste List Number from another document, then it reformats to match the
target (in the usual way of styles). There are of course other issues if
you paste in directly-formatted numbered paras, but that is true of
fonts, para spacing and so on too. But at least with the style-based
approach you have the chance of tidying things up systematically.

>4) How do you get round the problem that if the user hits Return twice, the
>numbering is removed from the new para but the style remains a list style?

Isn't that a bugger! For myself, hitting return twice is not something I
do often, and the marker of a blank para calls out for deletion anyway.
But essentially this comes down to a training issue - if you don't want
it numbered, choose a non-numbered style.

>All in all, as a simple StartListHere macro I can see how it could work, but
>as something sophisticated enough to replace Format Bullets and Numbering,

>I'm struggling with the implications. But I must admit I find the prospect
>of successfully jinxing Microsoft's best efforts to make reliable numbering
>impossible - and without having to resort to fields - a very enticing one;
>and if you have the patience to teach me, I think you'll find I make an
>appreciative pupil!
>
>Regards
>
>Dave
>

>Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message

>news:bBfV4BAw...@syntagma.demon.co.uk...

--

Dave Rado

unread,
Feb 12, 2000, 3:00:00 AM2/12/00
to
John, John and Margaret (and Bill)

Many thanks for all your tips.

Much appreciated.

Regards

Dave

0 new messages