Outline Numbering Hell - HELP !!

J

JSM

Hi,

After looking through these newsgroups I thought I had come across the
solution to copying styles with outline numbering from one document to
another, however I have come across a problem.

I have styles called Numbered Body Text Level 1 / 2 / 3 which are
based on the styles Numbered Heading Level 1 / 2 / 3 (this is so I can
use different formatting but keep the numbering flowing). The Numbered
Heading Level styles are set up with outline numbering. I have written
a macro which copies the styles to the active document then creates
the list templates accordingly. This works perfectly if none of these
styles are in the target file to begin with.

The problem is, if the document already contains the text formatted
with Numbered Body Text Level 1 / 2 / 3 styles, then the style for
that text is switched to Numbered Headling Level x as soon as I
specify the Linked Style for the list template level.

Any ideas how I can stop this happening? I am working with Word 2000
SP1. I can send the template containing the styles if it helps.

Cheers,

John

Code as follows:
*******************************
Dim aListTemplate As ListTemplate, Exists As Boolean

ActiveDocument.CopyStylesFromTemplate "c:\styles.dot"

For Each aListTemplate In ActiveDocument.ListTemplates
If aListTemplate.Name = "NumHeadings" Then
Exists = True
Exit For
End If
Next

If Not Exists Then ActiveDocument.ListTemplates.Add True,
"NumHeadings"

With ActiveDocument.ListTemplates("NumHeadings").ListLevels(1)
.NumberFormat = "%1."
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(0)
.Alignment = wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(1.5)
.TrailingCharacter = wdTrailingTab
.TabPosition = CentimetersToPoints(1.5)
.ResetOnHigher = True
.StartAt = 1
.LinkedStyle = "Numbered Heading Level 1"
End With

With ActiveDocument.ListTemplates("NumHeadings").ListLevels(2)
.NumberFormat = "%1.%2"
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(0)
.Alignment = wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(1.5)
.TrailingCharacter = wdTrailingTab
.TabPosition = CentimetersToPoints(1.5)
.ResetOnHigher = True
.LinkedStyle = "Numbered Heading Level 2"
End With

With ActiveDocument.ListTemplates("NumHeadings").ListLevels(3)
.NumberFormat = "%1.%2.%3"
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(1.5)
.Alignment = wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(3)
.TrailingCharacter = wdTrailingTab
.TabPosition = CentimetersToPoints(3)
.ResetOnHigher = True
.LinkedStyle = "Numbered Heading Level 3"
End With
 
B

Bruce Brown

Hi, John -

You say: > The problem is, if the document already contains the text
formatted
with Numbered Body Text Level 1 / 2 / 3 styles, then the style for
that text is switched to Numbered Headling Level x as soon as I
specify the Linked Style for the list template level.

How about simply not specifying that the Numbered Body Text Level
1/2/3 styles be linked to any list template at all, since they are
based on the Numbered Heading Level styles and it is those styles
which are linked to a list template, right?

You say you created the Numbered Body Text styles by basing them on
the Heading Level styles. So when you go to the Customize Outline
Numbered List dialog by editing a Numbered Body Text style, you should
find that it's the Numbered Heading style that's linked to the
appropriate level, not the Numbered Body Text style. The Numbered
Body Text styles are piggybacking their way into the list template
like stowaways.

If this "abstinence" approach doesn't work, how about using *two*
containers for styles -- AllOtherStyles.dot and NumberedStyles.dot?

You can safely copy AllOtherStyles.dot into any doc. Then test for
the existence of the numbered styles. If they don't exist, copy in
NumberedStyles.dot because, as you say, it works perfectly when the
numbered styles are not in the target doc.

But if they are, don't bother with NumberedStyles.dot.

By the way, have you ever tried re-starting a Numbered Body Text 1/2/3
style through Format > Bullets and Numbering > Restart? In Word 2002
you can't re-start the based-on, piggyback styles without getting the
same effect you're getting now: " . . . that text is switched to
Numbered Headling Level x."

We had a lively discussion a while back about basing outline-numbered
styles on Heading styles (or by extension any other outline-numbered
styles already linked to a list template). It seems to be doable but,
considering the problems with re-starting and copying, not without
potential glitches.

Hope these ideas will provide an escape hatch from your "hell." With
any luck, Margaret Aldis and Klaus Lincke will be along with further
(and probably more effective) succor. We can't bear to hear wailing
and gnashing of teeth above the roar of Microsoft's sulfurous flames.
- Bruce
 
J

JSM

Bruce,

Thanks for your reply. I am currently only linking the "heading"
styles to the list template, not the body text styles because as you
say, they are only piggy-backing on the back of the heading styles.

I've come to the conclusion that the only way I am going to get around
it is to not copy the numbered styles if they already exist (as you
suggested). I will only have to assume that the list templates are set
up correctly.

Cheers,

John
 

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