Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    List Templates (Word 2000)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: List Templates (Word 2000)

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

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Templates (Word 2000)

    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("Whic hListTemplate"), False, wdListApplyToWholeList

    Many thanks
    Jackie

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: List Templates (Word 2000)

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

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: List Templates (Word 2000)

    Have you tried the code in <post#=229862>post 229862</post#>.

    If you do a search for ListRestart (no spaces) you will find several related threads.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Templates (Word 2000)

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

    Thanks
    Jackie

  7. #7
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Templates (Word 2000)

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

  8. #8
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts

    Re: List Templates (Word 2000)

    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).ListTemplate s(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

  9. #9
    New Lounger
    Join Date
    Oct 2002
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: List Templates (Word 2000)

    Thanks Kim .... I appreciate the extra information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •