Problem with ContinuePreviousList in VBA Word 2007

P

petecjr

I have been using this subroutine to reformat and consecutively number items
from multiple cut and pastes from one doc to another in Word 2003. However in
Word 2007 each new section begins back at 1. I have tried everything I can
think of and nothing works. Please help. Time is crucial! Thanks.

Sub Example ()
Set mylist = ActiveDocument.ListTemplates.Add
With mylist.ListLevels(1)
.NumberFormat = "%1."
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = InchesToPoints(0)
.Alignment = wdListLevelAlignLeft
.TextPosition = InchesToPoints(0.25)
.TabPosition = InchesToPoints(0.25)
.ResetOnHigher = False
End With
Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=mylist, _
ContinuePreviousList:=True, ApplyTo:=wdListApplyToWholeList
end sub
 
S

s-kappel

I have been using this subroutine to reformat and consecutively number items
from multiple cut and pastes from one doc to another inWord2003. However inWord2007each new section begins back at 1. I have tried everything I can
think of and nothing works. Please help. Time is crucial! Thanks.

Sub Example ()
Set mylist = ActiveDocument.ListTemplates.Add
    With mylist.ListLevels(1)
        .NumberFormat = "%1."
        .TrailingCharacter = wdTrailingTab
        .NumberStyle = wdListNumberStyleArabic
        .NumberPosition = InchesToPoints(0)
        .Alignment = wdListLevelAlignLeft
        .TextPosition = InchesToPoints(0.25)
        .TabPosition = InchesToPoints(0.25)
        .ResetOnHigher = False
    End With
     Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=mylist, _
      ContinuePreviousList:=True, ApplyTo:=wdListApplyToWholeList
end sub

Pete -

If a Ctrl-Q on a selection of the pasted, macro-automated paragraphs
fixes it/them up as designed in 2003, then add a loop to 'reset'
paragraph attributes on all #'d paragraphs:

Dim objPara as Paragraph
For each objPara in ActiveDocument.ListParagraphs
objPara.Reset
Next

Sherry
 

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