Looping a Word macro over many list paragraphs causes memory issue

前端 未结 3 1428
醉话见心
醉话见心 2021-01-27 10:33

I\'m hitting problem with a reasonably straightforward vba macro for Microsoft Word which is designed to get around some issues we\'re seeing with list indentation when we creat

3条回答
  •  -上瘾入骨i
    2021-01-27 10:42

    Your code looks OK and my sugestions will be just ideas to try doing the same another way...
    Idea 1: insert a DoEvents somewhere in the innerloop, to facilitate garbage collection.
    Idea 2: simplify your code by using FOR EACH constructs:

    For Each curlist in Lists
        For each curPar in curList.ListParagraphs
           With curPar.Range.ListFormat.ListTemplate
              .....
           End With
        Next curPar
    Next curList
    

提交回复
热议问题