Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro populates Header and TOC (Word XP)

    Duh....
    I need to edit the styleref value.
    How are the switches applied in the editor of the field codes of the header properties?
    Any help would be appreciated

  2. #2
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro populates Header and TOC (Word XP)

    I'm trying to adjust the macro in the attached doc to populate the headers with a second level of numbering.
    They want the headers to drill down to the next level (i.e. the alpha chars).
    The attached 1 page sample would have values of 100.1 to 110.2. A
    Thanks for your help
    <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>
    Attached Files Attached Files

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro populates Header and TOC (Word XP)

    Are you creating the header from code, or manually.

    If manually then Insert > Field > Styleref and the switches appear as selections on the right.
    If by code then you can modify the value of fld.Code.Text

    StuartR

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro populates Header and TOC (Word XP)

    The person responsible does it manually through the field codes element in the header.
    I don't know if they'll allow me to write code because they could never maintain it.
    It looks like the w slash is what I need according to documentation, but I don't see any bookmarks in the document.
    Do I need to populate the bookmarks?
    Thanks

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

    Re: Macro populates Header and TOC (Word XP)

    What you are trying to do falls into the too hard basket for Word because you are trying to combine the paragraph numbers from two different paragraphs into the one styleref field (possibly a nested one).

    A macro solution will need to put a section break between every page, examine the first and preceding numbered paragraphs for each section (page) to find out the style names, examine the last and preceding numbered paragraphs for each section (page) and then use this information to customise the header for that section.

    Your best solution would be to negotiate with the document owner on why this is not sensible in its present form.

    If you used the full paragraph numbering on every paragraph eg the A becomes 101.1.A then the task becomes somewhat easier but it is still far from easy unless the SAME style is used for EVERY numbered paragraph.

    If you come up with a workable solution, I would love to hear what it is because I could probably use it myself - I know I've been asked for something like this before.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro populates Header and TOC (Word XP)

    I saw a switch ( w ) which places a bookmark in the heading.
    Can I use them in conjunction?
    Also, with the '=Formula' can I place a nested if statement?

    I'm thinking this is really looking like a programming venture.
    Has anyone encountered something like this?

  7. #7
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro populates Header and TOC (Word XP)

    OK, I'm thinking that I'm going to have to code this in order to get it done as soon as possible.
    What type of loop would you recommend to capture the values for the variables?
    Also, how would I generate the run-time pagination function?
    If I'm getting this right, I need to populate each fld.code.txt in a run-time pagination call.
    Is there a way to distinguish which is the top and which is the bottom field?
    I mean, do they have separate names or am I creating those too?
    I think I'll have a look in the object browser, I guess. <img src=/S/compute.gif border=0 alt=compute width=40 height=20>

  8. #8
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro populates Header and TOC (Word XP)

    I'm inclined to agree with Andrew on this one. The easiest way to code this will be to change the level 4 header so it includes the previous levels and then use a standard StyleRef

    StuartR

Posting Permissions

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