Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Aug 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA - Resetting paragraph numbers using code (Word 2000, '97)

    I have a large document made up of up to 10 documents inserted into the main document, each separated with a section break(new Page). I accept that right here is my problem, but given that I'm stuck with the multi doc in one, I have spent many hours using list, listparagraphs etc etc in order to get each sub document (within a section) to start from 1. Logically Goto section "n", find first paranumber, ContinuePreviousList=false. The problem is that lists are quite uncontrolled and cannot inthemselves be searched for. Has any genius amongst you found a way to handle this. Maybe I should use selections and the ListGalleries start from 1, but that seems very laborious. Any advice much appreciated

    Ian B

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: VBA - Resetting paragraph numbers using code (Word 2000, '97)

    Ian,

    First question: do the numbered paragraphs have styles applied to them i.e. is the numbering linked to a style?
    Numbered lists that are not linked to styles tend to be very sketchy to work with (from what I've read, not from what I know - having only worked with numbering in relation to styles).
    If the numbers are linked to styles, then you've got a good chance of making this work.

    Also, what kind of numbering is it, how many levels, and is the numbering requirement the same for evey section?

    Gary

  3. #3
    New Lounger
    Join Date
    Aug 2001
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA - Resetting paragraph numbers using code (Word 2000, '97)

    Hi Gary,
    Yes there are custom styles applied to all levels, going to 5 levels.
    I am starting to make progress by selecting the section, searching (in ascending order) for each of the custom styles, collapsing to start and then reapplying that style with .StartAt =1, but its still a long way from being perfect.
    I am working on setting a bookmark at the end of each of the reapplied style paragraphs and then repeating my search from this point forward, checking that I'm still in the same section.
    Not a pretty sight!

    Thanks
    Ian B

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: VBA - Resetting paragraph numbers using code (Word 2000, '97)

    Hi Ian,

    That doesn't sound too far off from something workable.
    If it's the case that you need the numbering to restart once for each section, then you should only need to set the first paragraph in each section, that has the first level numbering style, to continue previous list, no(?) (all the other numbered paragraphs after it should automatically follow suit.)

    Gary

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA - Resetting paragraph numbers using code (Word 2000, '97)

    Restarting at the beginning of each section as suggested by Gary should work fine; just make sure you don't have any text selected before applying the restart (else, a new list will be created).

    The way Dave Rado and others in the microsoft.public.word.numbering newsgroups recommend handling restarts like this is to include a "dummy restart" style (without numbering, but which re-starts your old top list style) at the top of your outlined numbered list template, and put a paragraph with that style at the beginning of each section.

    You should define the numbering for your new "restart style", and without leaving the numbering dialog, re-link the list styles for the other list levels in the outline list template. Giving the list template a name (at the bottom left of the dialog) is supposed to make your numbering more stable, too.

    That is quite a bit of extra work; but if all your sections start with a certain heading style that doesn't have numbering, you could use that style as your "dummy restart" style and don't have to apply any manual formatting (restarts).

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Regards, Klaus

Posting Permissions

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