I have a style object and I want to find if it has bullets or numbering
and the format of the bullet or number.
With ActiveDocument.Styles(n)
.ListLevelNumber works OK
.Type works OK
.ListTemplate gives an error message that the property is not
supported even though the Object Browser shows it as a property of the
Styles object.
How do I get the info I want?
Stefan Blom - 21 Sep 2006 08:50 GMT
The ListTemplate property is of type ListTemplate class. However, if
the style is not attached to a ListTemplate, the property has the
initial value NOTHING (which simply means an "empty" object
reference). You can use the Is operator to determine if an object is
NOTHING:
Dim x As Boolean
x = ActiveDocument.Styles("style_name_here") _
.ListTemplate Is Nothing
If x is False, the style is attached to numbering.

Signature
Stefan Blom
Microsoft Word MVP
> I have a style object and I want to find if it has bullets or numbering
> and the format of the bullet or number.
[quoted text clipped - 5 lines]
> Styles object.
> How do I get the info I want?
Jezebel - 21 Sep 2006 08:52 GMT
ListTemplate is an object, not a simple variable. You need to test whether
it is present as such --
With activedocument.styles(n)
if not .listtemplate is nothing then ...
>I have a style object and I want to find if it has bullets or numbering
> and the format of the bullet or number.
[quoted text clipped - 5 lines]
> Styles object.
> How do I get the info I want?
Ken - 22 Sep 2006 00:39 GMT
Thanks Guys
Ken - 27 Sep 2006 01:34 GMT
> Thanks Guys
Mayby I spoke too soon! "if not .listtemplate is nothing then.." works
fine for almost all styles except that I came accross a style in a
document then crashed Word at this statement - error trapping did not
work. I picked the style's parameters to bits and could not see
anything unusual and I was forced to delete the style and re-create.
Another style also gave trouble but error trapping worked.
It looks as though there are lots of bugs around lists.