none
Word Help RRS feed

  • Question

  • Hi,

    I have a word document that is being generated programmatically and I have two multi-level lists , with styles E1,E2, E3 and Heading 1, Heading 2 and Heading 3.

    When the content is associated with first three i.e E1, E2 and E3 styles, the numbering goes like this:

    1 This is top level with E1 as style

    1.1 this is Second level  E2 as style

    1.1.1 this is third level E3 as style.

    When the content is associated with Styles Heading 1, Heading 2 and Heading 3, the Top level numbering of this new list continues from previous.

    that is the output I get for the first instance of Heading 1, Heading 2, Heading 3

    2 This is top level with heading 1 as style

    2.1 this is Second level  heading 2 as style

    2.1.1 this is third level heading 3 as style.

     

     

    I would expect it to start the first instance of Heading 1 to start at "1". I know we can achieve this using the Right context menu and set "Restart at 1" . However, that is not my option. Because, this document is genrated programmatically is there any way, where we can write a macro so that the First instance of Heading 1 starts at 1 automatically when the user first opens the document. We use a predefined Document with a set of styles defined to populate the automated content. So ideally the macro should go inside this predefined template word document.

    Any help or ideas ..greatly appreciated.

    Thanks

     

     

     

     

    Monday, January 24, 2011 7:25 AM

Answers

  • Yes I tried to repurpose a built in style. All I did is changed the Font color and applied a numbering Format. 


    Ah, OK, then that explains the problem - for me, anyway...

    Unfortunately, you still haven't told us which version of Word is involved. As I mentioned in my previous reply, things are a bit different in every version - and that also includes the "command paths" we'd use in any instructions we give you.

    But to summarize what's required:

    1. You'd need to reset the built-in (Heading) styles (remove the numbering)

    2. Create a "List style" - separate numbering format - for each of the two sets of lists you want to use

    3. While defining these list styles, link each level to the appropriate paragraph style for that level.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by rythm20 Wednesday, January 26, 2011 5:50 AM
    Tuesday, January 25, 2011 8:19 AM
    Moderator

All replies

  • Hi Rythm

    I would only expect this to happen if you had linked the styles to the same List Style... Or if you tried to repurpose a built-in list style.

    Which version of Word are we dealing with (they all handle numbering slightly differently)?

    Can you give us repro steps for creating the List Styles and linking them with the two sets of styles?


    Cindy Meister, VSTO/Word MVP
    Monday, January 24, 2011 1:41 PM
    Moderator
  • Hi Cindy,

     

    Yes I tried to repurpose a built in style. All I did is changed the Font color and applied a numbering Format. 

     

     

    Monday, January 24, 2011 8:31 PM
  • Yes I tried to repurpose a built in style. All I did is changed the Font color and applied a numbering Format. 


    Ah, OK, then that explains the problem - for me, anyway...

    Unfortunately, you still haven't told us which version of Word is involved. As I mentioned in my previous reply, things are a bit different in every version - and that also includes the "command paths" we'd use in any instructions we give you.

    But to summarize what's required:

    1. You'd need to reset the built-in (Heading) styles (remove the numbering)

    2. Create a "List style" - separate numbering format - for each of the two sets of lists you want to use

    3. While defining these list styles, link each level to the appropriate paragraph style for that level.


    Cindy Meister, VSTO/Word MVP
    • Marked as answer by rythm20 Wednesday, January 26, 2011 5:50 AM
    Tuesday, January 25, 2011 8:19 AM
    Moderator
  • Hi Cindy,

     

    Thank you so much!!! This worked great!

     

     

    Wednesday, January 26, 2011 5:52 AM