Outline level auto-select custom style

S

Stuart Summerville

Hello,

I have a word document that has custom styles defined, each
for their own outline level.

It all works fine, except for one aspect: trying to alter
the level number in outline mode using Alt-Shift-Left/Right
correctly changes the level number, but it doesn't change
the style. eg. if current para is Level2, Style MyStle_L2,
hitting Alt-Shift-Left will set it at Level1, but the style
will stay at MyStyle_L2.

Any suggestions?

some other tidbits:
- the styles MyStyle_L1... MyStyle_L5 are all cascaded,
with MyStyle_L1 being based on Normal style.
- All these custom styles have the level<->Style mapping
set the same, presumably because I set them up in
MyStyle_L1, and the rest are cascaded versions of this.
- due to this problem, whenever I want to pro/de-mote a
para to another level, I always re-apply the required style
to the para. I never directly indent the para.
- The doc was originally made up of a mish-mash of other
styles and direct format/numbering edits applied all over,
which I've now totally replaced with my custom styles, and
all appears to work well, other than this problem.
- The only difference I can see between my custom styles
and the default Heading1... Heading5 styles is that the
defaults aren't cascaded, and the level<->style mapping
isn't done for all levels in all styles - just the
particular level for each particular style. The reason I'm
not concerned about this is that various outline info
websites (eg. 7 outline laws @ microsystems.com, and
shaunakelly.com) suggest doing things my way anyway.

Any help appreciated.
 
S

Stuart Summerville

FWIW, I'm using Word2003.

I notice various posts in ms.public.word.numbering about
this, largely saying it can't be done without the likes of
VBA, though those wereWRT Word 2002.

Why isn't that ng availabile from the
communities.microsoft.com newsgroup system?

Stuart.
-----Original Message-----
Hello,

I have a word document that has custom styles defined, each
for their own outline level.

It all works fine, except for one aspect: trying to alter
the level number in outline mode using Alt-Shift-Left/Right
correctly changes the level number, but it doesn't change
the style.
<snip>
 
S

stus

Ummm, Suzanne, don't my first two tidbits confirm that I have done
that? The only diff I can see against Shauna's instructions is that my
H1 is based on Normal, rather than NoStyle.
 
M

Margaret Aldis

Ummm, Suzanne, don't my first two tidbits confirm that I have done
that? The only diff I can see against Shauna's instructions is that my
H1 is based on Normal, rather than NoStyle.

If your styles are linked following Shauna's FAQ, so that each style is
linked to a level of the same numbering scheme, and if the numbering is
applied using the styles, then promoting/demoting list items other than the
first in a list should definitely change the style - so if that is not
happening either it's an indication that you haven't in fact managed to link
the styles correctly (e.g. by not working from the top level style
throughout), or that the numbering scheme that is applied is not actually
coming from the style but is a similar looking but non-linked outline
(direct formatting or possibly List Style), or that you have a corrupt
document.

Going back to your original post:
some other tidbits:
- the styles MyStyle_L1... MyStyle_L5 are all cascaded,
with MyStyle_L1 being based on Normal style.

Probably not significant, but I'd avoid cascading one numbered style from
another one. I suggest setting up a common unnumbered base, or possibly a
sequence of unnumbered bases for each of the levels (if you need the deep
cascade). Then derive each numbered style from the appropriate unnumbered
base.
- All these custom styles have the level<->Style mapping
set the same, presumably because I set them up in
MyStyle_L1, and the rest are cascaded versions of this.

It's the linking in the List Template (numbering scheme) that ensures that
each style is linked to the correct level - the cascading adds nothing apart
from a bit of confusion. However, if you tried to edit the numbering of a
lower level custom style directly, you will make a link from the style to
the top level of the list - I just retested this in Word 2003 and find I now
achieve an otherwise impossible link from the lower style to *both* levels
by this method <sigh>. (Built-in headings behave differently - they always
link to their preset outline level.) Personally I would superstitiously
avoid even *looking* at the numbering from the lower level styles, because
there is always the danger of clicking "OK" instead of "Cancel", and anyway
the B&N dialog has some dirty habits said:
- due to this problem, whenever I want to pro/de-mote a
para to another level, I always re-apply the required style
to the para. I never directly indent the para.

I'd say that was normally the best and more logical policy anyway, as you
are then applying the numbering via the style, rather than Word applying the
style from the numbering. But as noted above, if the styles are correctly
linked and applied, promote/demote should work everywhere except the first
item of a list (where it will change the numbering format instead), so the
failure is indication of a problem somewhere.
- The doc was originally made up of a mish-mash of other
styles and direct format/numbering edits applied all over,
which I've now totally replaced with my custom styles, and
all appears to work well, other than this problem.

If you are certain that the current styles are set up correctly, then we're
left with minor corruption as the only possibility, and this background is
the likely cause. You can never remove List Templates completely from a
document. Try saving out to unfiltered HTML and reopening/converting in
Word, or pasting all bar the last para mark to a new document. I'd also
reset all the panes of the B&N dialog, exit and restart Word, to clear out
the Registry.
- The only difference I can see between my custom styles
and the default Heading1... Heading5 styles is that the
defaults aren't cascaded, and the level<->style mapping
isn't done for all levels in all styles - just the
particular level for each particular style.

I don't know where you are getting this information from - default built-in
Headings aren't numbered, and if you use one of the standard B&N offerings
for Heading outline numbering you'll see they set up the linking at all
heading levels - indeed if this is not done you don't get correct number
restarting for lower level Headings. So I think you must be looking at an
incorrect/unusual set up in your own document history, where each Heading
has had its numbering defined separately?
 
S

Stu

Wow Marg... comprehensive reply that shows some holes in my
understanding of List templates etc... I'll get my head around this
soon, and ponder your suggestions. Then again, I could bypass that, and
just try the html export suggestion of yours ;)

Stuart.

Ummm, Suzanne, don't my first two tidbits confirm that I have done
that? The only diff I can see against Shauna's instructions is that my
H1 is based on Normal, rather than NoStyle.


If your styles are linked following Shauna's FAQ, so that each style is
linked to a level of the same numbering scheme, and if the numbering is
applied using the styles, then promoting/demoting list items other than the
first in a list should definitely change the style - so if that is not
happening either it's an indication that you haven't in fact managed to link
the styles correctly (e.g. by not working from the top level style
throughout), or that the numbering scheme that is applied is not actually
coming from the style but is a similar looking but non-linked outline
(direct formatting or possibly List Style), or that you have a corrupt
document.

Going back to your original post:

some other tidbits:
- the styles MyStyle_L1... MyStyle_L5 are all cascaded,
with MyStyle_L1 being based on Normal style.


Probably not significant, but I'd avoid cascading one numbered style from
another one. I suggest setting up a common unnumbered base, or possibly a
sequence of unnumbered bases for each of the levels (if you need the deep
cascade). Then derive each numbered style from the appropriate unnumbered
base.

- All these custom styles have the level<->Style mapping
set the same, presumably because I set them up in
MyStyle_L1, and the rest are cascaded versions of this.


It's the linking in the List Template (numbering scheme) that ensures that
each style is linked to the correct level - the cascading adds nothing apart
from a bit of confusion. However, if you tried to edit the numbering of a
lower level custom style directly, you will make a link from the style to
the top level of the list - I just retested this in Word 2003 and find I now
achieve an otherwise impossible link from the lower style to *both* levels
by this method <sigh>. (Built-in headings behave differently - they always
link to their preset outline level.) Personally I would superstitiously
avoid even *looking* at the numbering from the lower level styles, because
there is always the danger of clicking "OK" instead of "Cancel", and anyway
- due to this problem, whenever I want to pro/de-mote a
para to another level, I always re-apply the required style
to the para. I never directly indent the para.


I'd say that was normally the best and more logical policy anyway, as you
are then applying the numbering via the style, rather than Word applying the
style from the numbering. But as noted above, if the styles are correctly
linked and applied, promote/demote should work everywhere except the first
item of a list (where it will change the numbering format instead), so the
failure is indication of a problem somewhere.

- The doc was originally made up of a mish-mash of other
styles and direct format/numbering edits applied all over,
which I've now totally replaced with my custom styles, and
all appears to work well, other than this problem.


If you are certain that the current styles are set up correctly, then we're
left with minor corruption as the only possibility, and this background is
the likely cause. You can never remove List Templates completely from a
document. Try saving out to unfiltered HTML and reopening/converting in
Word, or pasting all bar the last para mark to a new document. I'd also
reset all the panes of the B&N dialog, exit and restart Word, to clear out
the Registry.

- The only difference I can see between my custom styles
and the default Heading1... Heading5 styles is that the
defaults aren't cascaded, and the level<->style mapping
isn't done for all levels in all styles - just the
particular level for each particular style.


I don't know where you are getting this information from - default built-in
Headings aren't numbered, and if you use one of the standard B&N offerings
for Heading outline numbering you'll see they set up the linking at all
heading levels - indeed if this is not done you don't get correct number
restarting for lower level Headings. So I think you must be looking at an
incorrect/unusual set up in your own document history, where each Heading
has had its numbering defined separately?
[/QUOTE]
 
S

stus

- due to this problem, whenever I want to pro/de-mote a
I'd say that was normally the best and more logical policy anyway, as you
are then applying the numbering via the style, rather than Word applying the
style from the numbering.

Well, my main concern about this method is that I don't fully
understand the implications of applying char/para styles to chars and
paragraphs, on formatting applied to existing text.

The best method to apply the style to alter the numbering is to just
click in some place in the paragraph and select the new style. This
*seems* to alter the style for the paragraph as I want, but I'm not
convinced I understand this fully... yet.
 
M

Margaret Aldis

Well, my main concern about this method is that I don't fully
understand the implications of applying char/para styles to chars and
paragraphs, on formatting applied to existing text.

The best method to apply the style to alter the numbering is to just
click in some place in the paragraph and select the new style. This
*seems* to alter the style for the paragraph as I want, but I'm not
convinced I understand this fully... yet.

You've got it :)

The tricky bit comes if you have any text selected - or accidentally drag a
little as you click. If it's just part of a paragraph, Word applies only the
font formatting of the paragraph (strictly, it's a "linked character style",
I think). This is an abomination as it looks like you have applied the para
style (the style name generally appears - possibly with a following "char").
However, you won't get any paragraph or numbering formatting in that case.

If you have selected a whole para with triple click or the selection goes
across a paragraph end, you get the paragraph style applied to all selected
paragraphs. "Short" bits of font formatting are preserved, but if it's more
than half the paragraph (I think) the font formatting of the paragraph style
takes over.
 
S

stus

My main problem in doing it this way is that sometimes I WANT that
action to apply the styles real formatting in various parts of the para
(eg. if it started out in some other style), while othertimes I WANT
the existing formatting preserved (eg. bolded text). I think Word is
tyring to be smart in guessing what I'm wanting in each case, but I've
yet to be convinced.
 
M

Margaret Aldis

If you explicitly want to clear out all font formatting, then select the
whole para, apply the para style, and then press Ctrl-space (default
paragraph font). That will remove all direct font formatting and all
character style formatting.

The best way of stopping Word ever changing font formatting without your
asking is to use character styles rather than direct formatting - even if
you have the whole paragraph in Strong style, say, that won't be removed
(compare to when the whole para is in bold direct formatting - if you select
the whole para the bold will be overwritten by the style font.)

You are also safe from Word being "smart" if you don't select any text when
applying the style, and if you only use direct formatting for the odd word
or two - not for bolding whole paragraphs.
 
K

Klaus Linke

Hi Margaret, Stu,

I don't think it works that way, unfortunately. You loose character styles just as easily as manual character formatting :-(
If more than 50% of the characters are formatted (manually or with a character style), the formatting will be removed by applying the paragraph style. It's a terrible nuisance, and there should be an option to turn off this AutoFormatting.

Word2003 has introduced link styles (also known as Char styles). But I hate them, and usually try desperately to get rid of them.
The idea is to create a character style, and link that character style to a paragraph style. The paragraph style's font formatting will be defined by the character style, and the character style will no longer appear in the list of styles. If you apply a paragraph style to a part of a paragraph, Word will apply the linked character style behind the scenes.
Seems to me that this just complicates matters without any benefit at all. I've never in 10 years (working with Word almost daily) felt the need to apply a paragraph style to part of a paragraph, so it seems like a solution to a problem that nobody has.

BTW, one stupid gotcha to look out if you try Alt+Shift+Left/Right: It won't work on the very first paragraph, probably because Word wants to teach you that yu can't have a level 2 paragraph without a level 1 paragraph above it.

Regards,
Klaus
 
M

Margaret Aldis

Hi Klaus

I've just tested this again to be absolutely sure - applying a paragraph
style over a paragraph with majority (even 100%) character style formatting
doesn't remove the character style on my system (Word 2003). I'm pretty
certain it has been like this since 97 or 2000, because I remember
explaining it to someone while working up some company templates at least 4
years ago.

Of course, if you only select part of a paragraph and apply the paragraph
style, you do override the character style with the paragraph-as-character
style (aka the built-in linked char style).

--
Margaret Aldis - Microsoft Word MVP
Syntagma partnership site: http://www.syntagma.co.uk



Hi Margaret, Stu,

I don't think it works that way, unfortunately. You loose character styles
just as easily as manual character formatting :-(
If more than 50% of the characters are formatted (manually or with a
character style), the formatting will be removed by applying the paragraph
style. It's a terrible nuisance, and there should be an option to turn off
this AutoFormatting.

Word2003 has introduced link styles (also known as Char styles). But I hate
them, and usually try desperately to get rid of them.
The idea is to create a character style, and link that character style to a
paragraph style. The paragraph style's font formatting will be defined by
the character style, and the character style will no longer appear in the
list of styles. If you apply a paragraph style to a part of a paragraph,
Word will apply the linked character style behind the scenes.
Seems to me that this just complicates matters without any benefit at all.
I've never in 10 years (working with Word almost daily) felt the need to
apply a paragraph style to part of a paragraph, so it seems like a solution
to a problem that nobody has.

BTW, one stupid gotcha to look out if you try Alt+Shift+Left/Right: It won't
work on the very first paragraph, probably because Word wants to teach you
that yu can't have a level 2 paragraph without a level 1 paragraph above it.

Regards,
Klaus
 

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