Have VBA tell me which ListGallery was used

K

Karitaat

Hi,

Is there a way to find out which ListGallery (wdBulletGallery,
wdNumberGallery, or wdOutlineNumberGallery) has been applied to a
Range?

I mean: if I fire Format > Bullets and Numbering I can see which Tab is
active.
Now: how can I find this out through VBA ?

regards,
peter
 
S

Stefan Blom

You can use the ListType property to determine the type of numbering
applied to a specific ListFormat object. For example:

TheListType = Selection.Paragraphs(1).Range.ListFormat.ListType

This returns a wdListType constant. Use the Object Browser (press F2
in the Visual Basic Editor) to find out the values of these constants.

See also Word VBA Help.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
C

Cindy M.

Hi Karitaat,
Is there a way to find out which ListGallery (wdBulletGallery,
wdNumberGallery, or wdOutlineNumberGallery) has been applied to a
Range?

I mean: if I fire Format > Bullets and Numbering I can see which Tab is
active.
Now: how can I find this out through VBA ?
Only indirectly. If you query the ListType

Selection.Range.ListFormat.ListType

This will return a wdListType enum, usually wdListBullet (value 2),
wdListSimpleNumbering (3) or wdListOutlineNumbering (4). These correspond
to the three galleries.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
K

Karitaat

Cindy, Stefan,

Thank you for your answer.
I never made the connection between the wd*Gallery and wdList*
constants.

Am I right to assume that I can only determine which ListTemplate was
used, by reading out
Selection.Range.ListFormat.ListTemplate.Name ?

Regards,
peter

Cindy M. schreef:
 
C

Cindy M.

Hi Peter,
Am I right to assume that I can only determine which ListTemplate was
used, by reading out
Selection.Range.ListFormat.ListTemplate.Name ?
Not even then, necessarily. ListTemplates only have names if you've
created them, with a name. The list templates from built-in numbering
is applied don't have names (actually, those aren't even list
templates, but that's a LONG story).

Good resources for numbering, and how to work with it, can be found at
www.syntagma.demon.co.uk and www.shaunakelly.com

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
K

Karitaat

Hello Cindy,

Thank you for your answer.
Yes: I know the work of Shauna Kelly and Margaret Aldis. Great stuff!

And I have had ehm... some interesting times trying to get to terms
with the wdOutlineNumberGallery.
I figure that Microsoft thinks: "If you can't convince them confuse
them".

Anyhow... I think I have domesticised the beast. With the help of this
forum and my good friend Google.
Because the VBA-Help was near to useless.

Thank you all.

regards,
peter

Cindy M. schreef:
 

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