ApplyListTemplate failure

G

gordon kush

I don't know anything about the MS Word 2000 object model and like i
less the more I see of it, but need a solution to the followin
problem. Any help is appreciated.

I have a document with lists that start correctly with #1, although
see they have "Continue with Previous List" set in Bullets an
Numbering. I need to change this Bullets and Numbering setting t
"Restart Numbering" for the sake of an HTML translator which i
screwing up the numbering. It apparently uses the Bullets and Numberin
setting rather than the ListFormat.ListValue to determine how to numbe
the list elements.

Example (in .doc file):

1. Step 1
2. Step 2

Intervening Paragraphs

1. Step 1.*
2. Step 2.

*Here, Bullets and Numbering shows "Continue with Previous List," eve
though the number value assigned to the list is "1".


What I'm trying to do is go through the doc, find all the list element
with a value of "1" and set "Restart Numbering" on each of them. Th
following finds the the "number 1's," but ApplyList appears to have n
affect. What's wrong?

Sub resetNums()
Dim P As Paragraph

For Each P In ActiveDocument.ListParagraphs
P.Range.Select
If P.Range.ListFormat.ListValue = 1 Then
P.Range.ListFormat.ApplyListTemplate _
P.Range.ListFormat.ListTemplate, _
False
End If
Next P
End Sub


Thanks
 
B

Bruce Brown

Gordon,

Why not first make a copy of the document then run this line of code:

ActiveDocument.ConvertNumbersToText

Then feed it to the HTML translator and see if its digestion is improved.

- Bruce
 

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