• Restart at 1 (for any sort of numbered list)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Restart at 1 (for any sort of numbered list)

    Author
    Topic
    #353756

    Here’s the other 3% that Andrew Cronnolly was worried about http://www.wopr.com/cgi-bin/w3t/showflat.p…rd&Number=21730

    I am essaying with a macro to reset numbering. I’d really like a toolbar button that says “Restart at 1” for any sort of numbered list i hav.

    The code below does the trick. The function takes a “restart” value as parameter. My little user macro cmd_RestartNumbering is temporarily set to force renumbering at “6” so it’s easy to spot when it works.

    I don’t understand this business of List Galleries and the like.

    My macro works no matter whether I am using ListNumber2 or ListNumber5. That ListTemplates(3) seems like a Red Herring.

    The formatting (paragraph indentation) gets screwed up. I’ve not got as far as worrying about that.

    The really sad news is my finding out that I’m not quite as brilliant as I’d have you all believe, and that I still need help!

    Nor have I started worrying about what happens when I restart numbering at “6” on a bulleted list.

    Function RestartNumbering(intStart As Integer)
        With ListGalleries(wdNumberGallery).ListTemplates(3).ListLevels(1)
            .StartAt = intStart
        End With
        Selection.Range.ListFormat.ApplyListTemplate _
            ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(3), _
            ContinuePreviousList:=False
    End Function
    
    Sub cmd_RestartNumbering()
        Call RestartNumbering(6)
    End Sub
    
    Viewing 0 reply threads
    Author
    Replies
    • #518214

      I don’t know how many times I’ve had to beat Word into submission wrestling with this.

      Thanks!

      Mike “Having way too much fun with those smilies.”

    Viewing 0 reply threads
    Reply To: Restart at 1 (for any sort of numbered list)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: