Changing Styles of Bulleted Lists (Word 2000/Windows)

D

Dan

Hello Again!

I seem to be misunderstanding ActiveDocument.Lists and ranges and once
again need some help.

What I am trying to do is find every line in a document that has a
bullet.

I then want to look at the style used for each line with a bullet.
(There should only be 5 styles ever used). Based on the style used, I
want to assign a different style. However, with the code I have, it is
changing all of the lines between the first bullet list and the last
bullet list in the document.

So I'm thinking I'm close, I'm just not defining my ranges correctly.
But I'm not sure what I need to change.

As always, any help will be greatly appreciated!

Dan
--
The code is:

Sub ChangeBulletStyles()
Dim oList As List
Dim opara As Paragraph
Dim oRng As Range

For Each oList In ActiveDocument.Lists
For Each opara In oList.Range.Paragraphs
Set oRng = opara.Range
If oRng.style = "Para 1.1" Then oRng.style = "List Bullet 2"
Else
If oRng.style = "Para 1.1.1" Then oRng.style = "List Bullet 3"
Else
If oRng.style = "Para 1.1.1.1" Then oRng.style = "List Bullet
4" Else
If oRng.style = "Para 1.1.1.1.1" Then oRng.style = "List Bullet
5" Else
If oRng.style = "Normal" Then oRng.style = "List Bullet"
Next opara
Next oList
End Sub
 
V

Vince

Dan,

This might work. I have not tested it, but you may want to give it a shot
for whatever it's worth.

Dim i As Integer

For i = 1 To ActiveDocument.Paragraphs.Count - 1

ActiveDocument.Paragraphs(i).Range.Select

If Selection.Range.ListParagraphs.Count = 1 Then

if selection.range.listformat.listlevelnumber>=1 then
' We have a bullet or any other word autonumbering (like a list)
if selection.style = "Original Style" then selection.style =
"New Style"
' So forth....
endif
End If
Next
 

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