Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Numbering / October 2006

Tip: Looking for answers? Try searching our database.

Have VBA tell me which ListGallery was used

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karitaat - 25 Oct 2006 14:34 GMT
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
Stefan Blom - 26 Oct 2006 11:05 GMT
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.

Signature

Stefan Blom
Microsoft Word MVP

> Hi,
>
[quoted text clipped - 8 lines]
> regards,
> peter
Cindy M. - 26 Oct 2006 11:08 GMT
Hi Karitaat,

> Is there a way to find out which ListGallery (wdBulletGallery,
> wdNumberGallery, or wdOutlineNumberGallery) has been applied to a
[quoted text clipped - 3 lines]
> 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 :-)
Karitaat - 26 Oct 2006 13:32 GMT
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:

> Hi Karitaat,
>
[quoted text clipped - 21 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M. - 27 Oct 2006 10:01 GMT
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 :-)
Karitaat - 27 Oct 2006 15:12 GMT
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:

> Hi Peter,
>
[quoted text clipped - 17 lines]
> This reply is posted in the Newsgroup; please post any follow question
> or reply in the newsgroup and not by e-mail :-)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.