As I said, the Headings should be using outline numbering if you want the numbers to relate to each other. If this was the case, the original code would have ignored the headings numbers.
Failing that, there are two other potential ways to sort the headings from the rest. Try either of the following in place of the If line:
If r.ListFormat.ListType = wdListSimpleNumbering And Left(r.Style,7) <> "Heading" Then
If r.ListFormat.ListType = wdListSimpleNumbering And r.ParagraphFormat.OutlineLevel < 10 Then
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
|