List numbering, oh lord yes, list numbering

J

jhmcmullen

Forgive me for asking about this, but I've been through the Word MVP
site and
this newsgroup and my head is swimming with terms and applications. I
want to
do the right thing but even after reading the materials, I don't seem
to be
clever enough to figure out what that is.

All right. That's the apology; now the situation, then the question,
last
the grovelling.

A developer group wants to take over the document I was
writing/maintaining
for them. Since I work in FrameMaker and they don't, I had to convert
it to
Word. That was convoluted enough (eventually I saved it as PDF,
exported to
Word and HTML from Acrobat, because the Word & RTF exports truncated
the file
long before the end). Then I raced through, remembering that I no
longer use
Word enough to do the sensible things. However, I stuck with the
provided
styles, though I did change the formatting. I created a couple of
character
styles (for code samples) and a couple of table styles.

And I manually applied list restarts whenever I did a subprocedure in a
numbered list.

Then they asked me to apply numbering to the Heading 1, Heading 2, etc.
I
did it at the top level, because it seemed to apply throughout.

Yeah, I know. Pride goeth, and so on. If it were troff, I'd have been
fine. Instead, the whole thing's about as sturdy as a Jell-O suspension
bridge.

Table styles reset spontaneously to match the hanging indent on the
bulleted table style, or they indent wildly. I even had it do serial
crashes
on me today.

Now I've been through all of the above-mentioned references and I'm
trying
to find a plan of attack to make the darn thing stable. I'm not a VBA
guy (or
even an OOPS guy; I'm from the old days of C and Fortran, and if I were
a
really good programmer, I wouldn't be a technical writer).

According to ?activedocument.listtemplates.count, there are only 6
templates
in this mess. That doesn't seem to be the issue, but everything else
looks
like list numbering bugs.

Logical design: Heading 1 through Heading 4. Bulleted lists can occur
at
any level, but procedures show up only after Heading 3 or Heading 4.
Substeps in the numbered procedures are indented and use alphabetic
numbering instead:

1. Do this.

Sometimes I comment on what has just happened.

2. Immanentize the eschaton:
a. Hail Discordia!
b. Microsoft == Eris

3. And, of course, sometimes there are options:
* This
* That
* The other thing

Tables contain table text, and bulleted lists.


Things I think I'm going to have to do:

1 redefine my heading numbering so I associate each heading level
with outline numbering, and using the important Dave Rado DON'T CLOSE
THE DIALOG hint.

2 set up List Number 2 to restart whenever List Number 1 occurs.

3 set up List Number 1 to restart--well, since it could be Heading 3 or
Heading 4, I can't use the heading (unless I'm misunderstanding,
which
is very likely); I'll need a dummy style to force renumbering.

I gather that steps 2 and 3 are best done with VBA.

What else do I need to do to clean this fershlugginer mess up? Copy all
but
the last paragraph into a new document? Set up the styles in a new
document and then copy it? Fix it in situ?

It's 112 pages; I'd rather not retype it.

I feel like I understand only the ugly parts and not the simple bits.

Any guidance you can give me would be greatly appreciated.
 
J

jhmcmullen

And, oh yes... Word 2003 SP 1 on XP.

The conversion process created a couple of hundred styles
and I think I've rooted them all out. The problems seem to be mine
and Word's.
 
C

Christopher B via OfficeKB.com

I think there's a solution for this, and I'm getting close to it, but it's
amazing to me that there are active newsgroups and web sites for this one
problem--eight years after Microsoft introduced its booby-trapped list
technology. As usual, "powerful" and "difficult" go hand in hand. I just
couldn't see the "powerful" part until I read some of the web pages. As you
seem to know already, list templates are independent of (but maddeningly
interacting with) style templates, and the only way to control them is by
defining your own list template in VBA. The six list templates that Word
happens to consider relevant to your document on a given afternoon seem to be
unstable and not subject to your control. The VBA code creates your own list
template-- but it needs to include all the list types you'll need.

Below is a macro in my template-- called "autonew", it runs when I create a
new document (but you can run it any time). In its current form it controls
ONLY numbered lists. My headings already work correctly (I'd better not say
that too loud or they'll spontaneously self-destruct). I'm not sure about the
intricate combinations of heading and list types that you describe. But I do
know that your macro must define all the list types that you'll want. And I
encountered a problem that applies to your question: I wanted to have the
same three styles work both in ordinary text or within a table, but my main
text has a left margin 1 inch from the real margin. In tables I don't want
that, so I needed two separate groups of list styles. But it seems to be
impossible to have two sets of numbered list styles, because they're using
the same list levels (1, 2, 3). So list styles need to work in tables without
alteration. Note: my macro defines only aspects relevant to list numbering;
other formatting of list styles is still in my paragraph styles. Some people
do this differently.

Just to give you the proper level of fear... when I was trying to create the
three separate styles to work in tables, my documents somehow decided that my
Normal style should be bulleted, so everything in the document had a bullet.
Nothing I could think of would remedy this except an AutoOpen macro to say
that Normal has NO LIST TEMPLATE. If anyone can tell me how to get rid of
this problem properly, let me know.

Before I show the code... I also have some brute-force klugey macros for
making lists that are actually tables but they look just like text. Not
elegant but very stable. I can post them if anyone is interested.

Chris Brewster
_________________________

Sub AutoNew()

' Sets up numbered list styles using the "MyLists" list template for
' paragraph styles named "List Number 1/2/3", to create multi-level
' lists with this formatting:

' 1. First level
' a. Second level
' i. Third level
' ii. Third

'Check if the "MyLists" ListTemplate exists

Dim aListTemplate As ListTemplate
Exists = False
For Each aListTemplate In ActiveDocument.ListTemplates
If aListTemplate.Name = "MyLists" Then Exists = True
Next aListTemplate

'Create it if it doesn't

If Not Exists Then
Set newList = ActiveDocument.ListTemplates.Add _
(OutlineNumbered:=True, Name:="MyLists")
End If

'List Number styles

With ActiveDocument.ListTemplates("MyLists").ListLevels(1)
.NumberFormat = "%1."
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.Alignment = wdListLevelAlignLeft
.NumberPosition = InchesToPoints(1#)
.TextPosition = InchesToPoints(1.25)
.TabPosition = InchesToPoints(1.25)
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "List Number"
End With
With ActiveDocument.ListTemplates("MyLists").ListLevels(2)
.NumberFormat = "%2."
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleLowercaseLetter
.Alignment = wdListLevelAlignLeft
.NumberPosition = InchesToPoints(1.25)
.TextPosition = InchesToPoints(1.5)
.TabPosition = InchesToPoints(1.5)
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "List Number 2"
End With
With ActiveDocument.ListTemplates("MyLists").ListLevels(3)
.NumberFormat = "%3."
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleLowercaseRoman
.Alignment = wdListLevelAlignLeft
.NumberPosition = InchesToPoints(1.5)
.TextPosition = InchesToPoints(1.75)
.TabPosition = InchesToPoints(1.75)
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "List Number 3"
End With


End Sub
 
C

Charles Kenyon

Do go through the steps that Shauna Kelly prescribes. They work.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
C

Christopher B via OfficeKB.com

I've read Shauna Kelly's description and my reaction was: it involves more
steps than I want to do repeatedly, and I suspect the result still wouldn't
be stable. The list templates still aren't under control. I got my VBA
solution (previous post) from another site and adapted it to my needs (and
English units of measure). Here it is:

http://word.mvps.org/FAQs/Numbering/ListRestartFromStyle.htm

Chris

Charles said:
Do go through the steps that Shauna Kelly prescribes. They work.
I think there's a solution for this, and I'm getting close to it, but it's
amazing to me that there are active newsgroups and web sites for this one
[quoted text clipped - 120 lines]
 
S

Suzanne S. Barnhill

You don't have to do the steps repeatedly if you associate the numbering
with specific styles in a template and use that template when you want that
kind of numbering.



Christopher B via OfficeKB.com said:
I've read Shauna Kelly's description and my reaction was: it involves more
steps than I want to do repeatedly, and I suspect the result still wouldn't
be stable. The list templates still aren't under control. I got my VBA
solution (previous post) from another site and adapted it to my needs (and
English units of measure). Here it is:

http://word.mvps.org/FAQs/Numbering/ListRestartFromStyle.htm

Chris

Charles said:
Do go through the steps that Shauna Kelly prescribes. They work.
I think there's a solution for this, and I'm getting close to it, but it's
amazing to me that there are active newsgroups and web sites for this
one
[quoted text clipped - 120 lines]
 
M

Margaret Aldis

A few additional thoughts (from a fellow tech writer and sometime Frame
user):
Table styles reset spontaneously to match the hanging indent on the
bulleted table style, or they indent wildly. I even had it do serial
crashes
on me today.

You might want to think again about the Table Styles - I've found table
positioning more difficult with them than without them. Check your Table
Properties - Options button and make sure "Automatically resize" is off.

Take the serial crashes as an indication that you need to do some cleaning
up. See http://www.gmayor.com/what_to_do_when_word_crashes.htm
Now I've been through all of the above-mentioned references and I'm
trying
to find a plan of attack to make the darn thing stable. I'm not a VBA
guy (or
even an OOPS guy; I'm from the old days of C and Fortran, and if I were
a
really good programmer, I wouldn't be a technical writer).

Hmm, interesting to think what the response would be if you decided you'd
take over the software you are documenting. I wonder who is santioning and
paying for this handover of doc to developer team. Hope you have costed the
effort involved and will continue to cost the support you'll have to give to
untangle the documents!
Logical design: Heading 1 through Heading 4. Bulleted lists can occur
at
any level, but procedures show up only after Heading 3 or Heading 4.
Substeps in the numbered procedures are indented and use alphabetic
numbering instead:
Tables contain table text, and bulleted lists.

I'd use paragraph styles for those, but if you have developers pasting text
between tables and ordinary body you may want to simplify the design so as
not to use separate styles. Alternatively a clean-up macro that applies
corresponding table/no-table styles according to context can be very useful.
Things I think I'm going to have to do:

1 redefine my heading numbering so I associate each heading level
with outline numbering, and using the important Dave Rado DON'T CLOSE
THE DIALOG hint.

Yes - follow Shauna's step-by-step and you should be quite safe here.
2 set up List Number 2 to restart whenever List Number 1 occurs.

3 set up List Number 1 to restart--well, since it could be Heading 3 or
Heading 4, I can't use the heading (unless I'm misunderstanding,
which
is very likely); I'll need a dummy style to force renumbering.

Yes, definitely put List Number styles into a multi-level (outline) list. If
you didn't have numbering on the Headings 3 and 4 you could keep them in the
outline (with no number) and use levels 5 and 6 for the step numbers. But
that will produce a jump in numbering if there is a "missing" level (Heading
3, then steps, then Heading 4 will number the Heading 4 as if there were
another one between Heading 3 and first set of steps.) So in your case use a
separate outline list for the step numbers. I usually use another separate
outline for the bullet lists - you can still mix and match the list items.

If this is going to be maintained by developers then if you can't find a
real style to restart the top level list you may be better off in Word 2003
using the right-click command. Whatever, you will need to think about how
you make sure all the developers do the same thing and avoid the nasty
areas. If you go for a dummy style or hidden LISTNUM to restart then you
will have to support that with a custom toolbar and a modicum of user
training - works well if you do that, but you'll just get messy documents
back to tidy up if you don't. See
http://www.word.mvps.org/FAQs/Numbering/ListRestartMethods.htm.
I gather that steps 2 and 3 are best done with VBA.

If you'd rather not, you don't need to use VBA in Word 2003 to set up good
style-list linking, just adapt the method explained for Headings in
http://www.shaunakelly.com/word/numbering/OutlineNumbering.html for the List
Number styles.
What else do I need to do to clean this fershlugginer mess up? Copy all
but
the last paragraph into a new document? Set up the styles in a new
document and then copy it? Fix it in situ?

I would create a clean template to embody your document design, if you
haven't done already. Then you will have a fresh source of document shells
to paste converted text into - you can get rid of a lot of mess this way.

Remember that direct formatting overrides styles, as in Frame. Turn on Tools
Options > Edit "Keep track of formatting" and you can see a lot of this in
the Styles and Formatting Pane (Show Formatting in use). This is enormously
helpful in tidying up documents, though it doesn't necessarily distinguish
direct formatted numbering that looks like the style number formatting. Use
Ctrl-Q (reset paragraph formatting) to be sure to get numbering from style.

Turn off all or most Smart Paste options - these seem to have a fairly
disastrous effect on style-based numbering. Check out other advice on
options.

See here for links to other important "long document" issues:

http://daiya.mvps.org/bookword.htm
 
J

jhmcmullen

Thank you to everyone for all of your help, but I don't seem to
have licked the problem yet.

Minor clarification: When setting up a list to restart after some
non-list
paragraph style, I place the cursor in that style (call it List Start
for convenience) and set that as Level 1, correct? Level 2 then
gets associated with List Number, Level 3 with List Number 2, and so
on for the 5 styles of List Number. Just so I can think I'm doing that
correctly.

*sigh* This is fraught with problems.

Problem one: As soon as I try to modify a style in the
existing document, Word crashes.

Okay. Went back to an earlier version, before the heading
numbering was added. It's a fraction more stable.

And it's tedious getting rid of all of the temp files, but I'm doing
it.

Problem one-and-a-half: IT upgraded me to XP yesterday
while I was crashing at home, and forgot some essential items,
like giving me permissions to actually install the software they
don't want to install (and run company-mandated software
besides). Fixed now, though I'm occasionally running
into "Oh, *that's* not there yet." But--bright side--it does mean
that I'm working with a pristine copy of Word. At least, until I
started playing with documents again.

Problem two: Applying the heading numbering causes
the fershlugginer Word to go to la-la land. It freezes.
Like hourglass for anhour before I kill it freezes. I figured
this was a side effect of the ugly convoluted document I was
working with, so--

Attempted solution: Start with a new blank document;
pasting as unformatted text and reformatting won't take
as long as the current attempts to fix things up.

Problem three: Still freezes with a new document. And
I'm getting listgallery musical chairs; lists aren't holding
on to the list names I'm creating. I'm pretty sure that I was
consistent with assigning the listgallery values (there are
only three: headings, bullets, and procedures, so I have
enough listgalleries to go around).

Has anybody seen this? I'm up to this week's patches,
so I suppose it could be an interaction with a new security
patch, but I wouldn't expect it. (I know, no one expects the
Microsoft Unexpected.)

Heck, looks like I might be back to VBA after all... (Time
to get the O'Reilly Word Macro book.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top