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

Problems with List Templates (technical)

11 views
Skip to first unread message

Margaret Aldis

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Hi -

This is an update on the use of List Templates created 'the VBA way'
which may be of interest to Dave Rado, John Nurick and anyone else who
has been following this. I'd be interested in any feedback from people
who've seen the same problems or have found further workarounds.

I've found what appear to be some limitations on just how firm the link
is between the style and List Template.

Firstly - the good news - I've not so far been able to induce any
problems with updating styles from a template including styles linked to
named List Templates.

I have, however, had problems with copying numbered styles between
templates using the Organizer. Typically, what happens is that the
styles work fine in a document created from template for new text, but
may fall apart on copy and paste. For example, pasting in a numbered
list (using the same list styles) from an old document using styles with
different indents comes in with these old indents preserved as direct
formatting instead of automatically conforming to the style of the
target. Pasting may also redefine the style (as it does when styles are
bulleted or numbered using the List Gallery). The main lesson here seems
to be simply to always create your bulleted and numbered styles afresh
in each template and don't try to copy them using the Organizer.

The second area where things seem not to be quite as solid as we hoped
is in what exactly is happening when you copy and paste styled
paragraphs from one document to another, even when both documents use
styles linked to named List Templates. This is the scenario:

* Two documents each containing Heading Styles. These are numbered in
target document (doesn't matter whether they are numbered or unnumbered
in the source.)

* Copy some headings from source to target. The headings take on correct
numbering (provided you have some existing examples of the heading
styles).

* Run a macro to unnumber headings (link the style to 'None'). Headings
made in the original document unnumber correctly, but those that were
pasted in acquire a 'direct formatting' number, which seems to always be
at list level 1.

* Run the macro to relink heading styles to the named List Template. The
imported headings now change style to all become Heading 1s.

This behaviour seems to imply that when the headings are pasted in, Word
links them to the named List Template, but not 'via' the style. (The
behaviour mimics the situation where you paste a directly formatted
paragraph into a document where its formatting happens to match the
style - it will appear to be a normally styled paragraph unless and
until you change the style, in which case its direct formatting history
will suddenly reappear.)

Comments on a postcard please ...

--

Margaret Aldis, Syntagma, e-mail Margare...@syntagma.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

Bill Coan

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Hi Margaret,

My approach to outline numbered lists has been to avoid "Automatically
update document styles" under "Tools|Templates and Addins" and also to avoid
the Organizer.

Instead, I include with each template a Setup macro that does the following:

1. Define style attributes (other than numbering) for all heading levels.
2. Look for my special listtemplate by name and create it if not found but
use the existing one if it is found.
3. Define the numbering for each outline level and use the LinkedStyle
property to attach each level to the corresponding Heading style.
4. Apply the listtemplate using
ActiveDocument.Content.ListFormat.ApplyListTemplate.

This macro can be run repeatedly without causing problems, although it needs
to be run only once to fix a template during development. The nice thing is
that it can be run repeatedly on legacy documents after they're attached to
a new template.

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

Margaret Aldis

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Hi Bill -

Thanks for your response. Personally I'm happy not to use the Organizer
(or to rerun the list set-up macro after its use) and it is effectively
out of bounds for users anyway (they are supposed to use the styles
provided in existing templates, or create new templates 'under my
supervision'). However, the Update styles from Templates and Add-ins is
handy to have (and one of the reasons I went down the VBA route),
especially during this beta period when we are fine-tuning styles. But
anyway that seems to work reliably with styles linked to named List
Templates, so there doesn't seem to be any need to avoid it.

My list set up code is as you describe, apart from the last step of
applying the ListTemplate to the entire document. I tried this and it
doesn't make any difference to the copy and paste effect I described,
and anyway has an additional unwanted and surprising effect of making
any paragraph with an *outline* level of 1 turn into a Heading 1
heading! (Since I deliberately use outline level 1 for certain styles
which are not Heading 1s, and since the Document Map applies it to short
paragraphs with cavalier disregard, this would be make quite a big bug
in my 'Number headings' macro!)

The copy and paste effect could be a problem for me if users change
their mind about whether to number headings after pasting in some
heading styled text. (They have the option to number or unnumber the
heading styles from a menu item). However, the initial effect is fairly
obvious (numbers appearing in an otherwise unnumbered document) and
easily and 'intuitively' fixed with a Ctrl-Q to reset the para style, so
I think I shall treat it as a 'training issue' <g>.

Regards

Margaret


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

Bill Coan

unread,
Apr 10, 2000, 3:00:00 AM4/10/00
to
Hi Margaret,

Ramifications, always ramifications!

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

Margaret Aldis <Marg...@nospam.demon.co.uk> wrote in message
news:2oAOCOAe...@syntagma.demon.co.uk...

0 new messages