• List Templates (Word 2000)

    Author
    Topic
    #385163

    Well I’ve tried MSDN but there’s no-one who can help … hopefully you guys and girls are far more knowledgeable !!!

    In VBA I am attempting to restart numbering on a numbered style. There are three List Galleries (bulleted/numbered/outline numbered), each List Gallery has List Templates from 1-7. The problem I’m encountering is the List Template number I require. If I record a macro it will pick up the List Template as number 6 – I need to know how to get to the List Number as it will not always be number 6.

    I have looked at setting up a long and picking up the List Template number but no joy (styStyle.ListTemplate) there is no option for number. There is a name option, when I put the relevant code in the immediate window there appears to be no name … basically as you may have guessed I’m not getting very far !!!

    Any help would be greatly appreciated.
    Thanks
    Jackie

    Viewing 1 reply thread
    Author
    Replies
    • #663413

      You will need to name your list templates. See the thread starting at post 167468, in particular the replies by Klaus Linke.

      • #663707

        Afternoon Hans

        Thanks for the information. Unfortunately I’m still stuck with the problem, I need to know how to “Restart Numbering” at (1) on a different section. The only option I can see is “ApplyListTemplate” function which gives me the option to “ContinuePreviousList” – which in this case needs to be false. When the code runs with the ListTemplate hardcoded it works fine, but if I name the ListTemplates (as per Klaus’ instruction) then run the code it debugs.

        The code I’m running is:

        docDocument.Styles(styStyle).ListTemplate.Name = “WhichListTemplate”

        rngRange.ListFormat.ApplyListTemplate ListGalleries(wdNumberGallery).ListTemplates(“WhichListTemplate”), False, wdListApplyToWholeList

        Many thanks
        Jackie

        • #663733

          I’m afraid I’m out of my depth here, but I’m sure some other Lounger will help you (Klaus, where are you?)

          • #663931

            Hans …. Thanks for your help, even if you were out of your depth !!

            • #664017

              Here’s a little more info from my experience with numbering, for what it’s worth. You can address a specific panel in the List Templates through VBA code:

              ActiveDocument.Styles(“Heading 1”).LinkToListTemplate ListTemplate:= _
              ListGalleries(wdOutlineNumberGallery).ListTemplates(5), ListLevelNumber:=1

              In this code, I linked Heading 1 style to ListTemplate number 5 (the sixth panel, counting from 0 in the upper left). However, there is danger in this. If you reuse this code with frequency, that panel can become corrupted. If you hightlight that panel and click reset, you will clear the corruption. (Or maybe it’s just confusion.)

              The List Templates panel is specific to your computer. You could run the above code on one computer with no problem, but on another computer, the exact code might return an error because that particular panel was corrupted due to overuse. When you open a document, information about the numbering is loaded into one of the List Templates panels on your computer as a temp area in which to display and interpret the numbering from the document.

              MSoft thought users could set up their own numbering schemes here (which works OK if you are the only one using the computer OR the document AND you don’t have more than 7 schemes). But it is far more dynamic than that. A friend and I once passed the same Word 97 document back and forth, making minor changes to the numbering scheme and watched as it used panel 7, then panel 6, then panel 5… until each panel in the List Templates dialog was overwritten (except 0), then started over with 7 again. If I had laboriously set up numbering schemes, they would have been gone with the wind — until I opened a document with one of my schemes in it. Then the next available panel would reflect my numbering scheme.

              So, when I started experiencing corruption in a specific List Template panel, I abandoned trying to address a specific panel. An alternative would be to reset the panel you want to use before addressing it in code. But it seemed to be healthier for the List Templates panels to allow Word to use whatever panel was handy, the code worked just fine without specifying a panel, and I stopped getting reports of error messages.

              I hope this extra info is helpful.

              Kim

            • #664260

              Thanks Kim …. I appreciate the extra information.

    • #663810

      Have you tried the code in post 229862.

      If you do a search for ListRestart (no spaces) you will find several related threads.

      • #663930

        Andrew ….. You absolute star, works fabulously well.

        Thanks
        Jackie

    Viewing 1 reply thread
    Reply To: List Templates (Word 2000)

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

    Your information: