TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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