• List numbering follies

    Author
    Topic
    #1767464

    In a document I created using Word’s Manual template, I changed the font of the number in the List Number style. Now, when I apply that style to lists, the font of the number changes (good), but the lists no longer restart at 1 (bad). Why does this happen, and how does that default automatic restarting at 1 (that is part of the template) work?

    (I also note that there is no Restart Numbering option in the Numbering gallery when creating or modifying a style.)

    Viewing 2 reply threads
    Author
    Replies
    • #1774923

      Yep, its a problem due to the fact that lists require a LOCAL formatting change to restart the list. I use macros to handle restarting or continuing lists as posted below.

      Sub ListContinue()
      ' Resets paragraph formatting on the current selection
      ' Is used in a List to continue numbering from previous list
          Selection.ParagraphFormat.Reset
      End Sub
      
      Sub ListRestart()
      ' Macro created by Rob Phillips
      ' Resets numbering of current list to restart numbering
       Dim MyList As ListFormat
       Set MyList = Selection.Range.ListFormat
       MyList.ApplyListTemplate ListTemplate:=MyList.ListTemplate, ContinuePreviousList:=False
      End Sub
      

      • #1774935

        Thanks Andrew,

        I recorded my own macro (and cut out the unnecesary parts) to do renumbering:

        Sub restartListNumberingAt1()

        With ListGalleries(wdNumberGallery).ListTemplates(4).ListLevels(1)
        .StartAt = 1
        End With
        ListGalleries(wdNumberGallery).ListTemplates(4).Name = “”
        Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _
        wdNumberGallery).ListTemplates(4), ContinuePreviousList:=False, ApplyTo:= _
        wdListApplyToWholeList, DefaultListBehavior:=wdWord9ListBehavior
        End Sub

        I still don’t know how the default style in that template does it automatically when I applied it to sevearl consecutive paragraphs of plain text.

      • #1774945

        Can’t let the return of Andrew Lockton go without notice:

        WELCOME BACK ANDREW!!

        • #1774965

          [redHERE!HERE! I’ve seen only 2 posts & already I have two new macros. Thank you, Andrew.

        • #1774971

          Hi Gary and Phil – and happy new year

          I had low expectations of continuing to hang out here after the first return of the Lounge but this one is a huge step up from the mid-life crisis of Ikonboard.

          Andrew

      • #1775349

        The code for the ListRestart procedure generates a “Run-tome error ‘S’ Invalid procedure or argument” error in the line

        MyList.ApplyListTemplate ListTemplate:=MyList.ListTemplate, ContinuePreviousList:=False

        Any idea why?

        • #1775351

          The macro won’t work if your cursor is not in a list already. Make sure the selection is in an automatic list before running the macro to avoid that error.

          Maybe I need an error catcher in there but I have never tried to restart a list where one wasn’t already applied.

          • #1775443

            I think I may have cought what might be the issue. At least, if what you mean by “automatic list” is a numbered list that you create by clicking the Numbered List button when Body Text (or Normal text) is selected.

            But I am not doing that. Instead, I am creating lists the “proper” way: by using styles, and the styles that are part of the Manual template in W2K.

            In the default style, when the style is applied to one or more selected paragraphs, the foramtting and numbering is applied, and the numbering for the selected paragrpahs starts at 1. But when I modified the style (paragraph spacing and number font), applying that style no longer restarts numbering at 1 for the selected paragraphs.

            When I run the macro you offered on the paragraphs that have been givin formatting and numbering in this way, the error appears.

            • #1775450

              writer

              If the number is applied by using a style then it must be automatic ie. you can’t select the number no matter how hard you try.

              The actual smarts which restart the number is a local formatting change which must be applied to the first element of the list. Just applying a numbered style with no local formatting will make the list continue from the last occurence of that list item (Word 8). However in the code you posted I noticed that there is another option on the ApplyList line which allows

              DefaultListBehavior:=wdWord9ListBehavior

              I have not seen this in Word 8 and rarely use Word 9. That option indicates that maybe Microsoft smartened up the lists because of this problem in Word 8 and maybe there is an option somewhere that makes a list restart if it’s pattern is broken like it used to in versions before Word 8.

              Perhaps there is a syntax issue with Word 2000 that I am not aware of. In any case, use whatever works. If your code does the trick then go ahead and use that. It may be worth examining the other options for DefaultListBehavior as that will most likely do something along these lines.

      • #1789598

        I just used the ListRestart macro. I haven’t read any of the other posts – just found that, used it and it worked. Thanks, Andrew.

    • #1777116
    • #1777893

      I see I’m not the only one who can’t figure out how the list number style in the manual template restarts automatically at one!! Is it possible that there is a macro controlling the behavior of this style? I’d love to be able to reproduce the behavior, so if anybody has any idea how to do so I’d be very interested.
      Thanks!
      Rose

    Viewing 2 reply threads
    Reply To: List numbering follies

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

    Your information: