Hi all

I'm trying to figure out how to get the ListTemplate index/name for a
specific style -- I'd like to be able to modify the style's LinkedStyle and
in order to do that it seems I have to specify the Style's ListTemplate first.

Just to test if I can identify it, I tried the following code

Set mystyle = ActiveDocument.Styles("Level 1")

MsgBox ActiveDocument.ListTemplates(mystyle.ListTemplate.Name). _
ListLevels(1).LinkedStyle

I don't get an error but the result of "mystyle.ListTemplate.Name" is "" (ie
nothing).

Any pointers? Thanks in advance!

Chuck

Re: ListTemplate index - how to get? by Chad

Chad
Thu Aug 26 15:55:59 CDT 2004

Chuck,

ListTemplates are not given a name automatically, only when you specifically
set one using VBA. However, why not just return a reference to the list
template like this:

Set oLT = ActiveDocument.Styles("Level 1").ListTemplate
sLkStyl = oLT.ListLevels(1).LinkedStyle
MsgBox sLkStyl

Regards,
Chad


"Chuck" <Chuck@discussions.microsoft.com> wrote in message
news:93D4D19B-79DA-48FA-83BA-64006614C09C@microsoft.com...
> Hi all
>
> I'm trying to figure out how to get the ListTemplate index/name for a
> specific style -- I'd like to be able to modify the style's LinkedStyle
and
> in order to do that it seems I have to specify the Style's ListTemplate
first.
>
> Just to test if I can identify it, I tried the following code
>
> Set mystyle = ActiveDocument.Styles("Level 1")
>
> MsgBox ActiveDocument.ListTemplates(mystyle.ListTemplate.Name). _
> ListLevels(1).LinkedStyle
>
> I don't get an error but the result of "mystyle.ListTemplate.Name" is ""
(ie
> nothing).
>
> Any pointers? Thanks in advance!
>
> Chuck