Re: Word: Detecting a bulleted list vs. a numbered list

Subject: Re: Word: Detecting a bulleted list vs. a numbered list
From: Sandy Dixon <sdixon -at- BBN -dot- COM>
Date: Mon, 21 Jun 1999 12:40:26 -0400

>For each instance of a specific style (List) in a document, I need to
>determine whether the entry has numbers or bullets associated with it. Based
>on this determination, I then need to convert the style to a new style
>(Bullet List or Number List).
>
>Has anyone ever done something like this?

That's very similar to a VBA program I am working on now. I query to find
out if a paragraph is a bulleted list (ie. Normal style with bullets added)
and if so, change style to "List Bullet". I've cut and modified stuff from
my code...hopefully this will give you ideas...to check for numbered lists,
I think you need to add an elseif statement to check for another type of
ListType. There are a few that seem to relate to numbered lists
(wdListListNumOnly, wdListMixedNumbering, wdListNoNumbering, and
wdListSimpleNumbering) and I haven't investigated the diffferences yet.

Dim docorig as Document
Dim m as Long
Dim para as Paragraph

Set docorig = ActiveDocument
m = 1
For Each para In docorig.Paragraphs

docorig.Paragraphs(m).Range.Select

If Selection.Range.ListFormat.ListType = wdListBullet Then
Selection.Paragraphs(m).Style = "List Bullet"
End if

m = m + 1
Next para

Please let me know if this is helpful at all.
-Sandy


From ??? -at- ??? Sun Jan 00 00:00:00 0000=



Previous by Author: Re: Any UNIX users out there?
Next by Author: Get a job
Previous by Thread: Word: Detecting a bulleted list vs. a numbered list
Next by Thread: graphics reference


What this post helpful? Share it with friends and colleagues:


Sponsored Ads