Odeslat dotazOdeslat dotaz
 

OdpovědětPost-process the result of the INDEX

  • 1. července 2009 16:21Karthik.SK Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Dear friends,

    I had an issue with word indexing . I had posted my question initially in "word general questions" which is below for your reference


    "> I have a question is indexing.. If i am doing indexing for integer/numeric
    > starting values like "1-North street" its displaying in index under the
    > heading "1".
    >
    > Is there any option to display all the numeric starting values under a
    > common heading(say numerics)????"


    and the reply i have got from few is

    "I think there isn't. You'd have to post-process the result of the INDEX
    field each time you update the index.

    If you need this functionality a lot, a macro doing the post-processing
    (basically deleting all the 1/2/3/... headings in the TOC and inserting
    one "Numerics" heading) is certainly feasible."

    I am not exactly able to catch up the point here. Do anybody got worked out samples for this issue?

    Thanks in advance.

Odpovědi

  • 3. července 2009 10:56Cindy MeisterMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Karthik

    I don't have any code for this - I've never tried this particular exercise...

    What the person answering means is that you need to "walk" the Index entries (TOC was probably just a lapse of concentration) - probably paragraphs, but it will depend on the type of Index. Where you find a number as the first character of an entry, your code would delete that and any other extraneous characters (dashes, spaces, etc). Do that until the numbers stop.

    At the same time, also delete the "section heading" for each number (1, 2, 3, etc).

    And, of course, at the top insert the "section heading" you want to see.

    As the person notes, this code would have to be run again everytime the Index is updated. This is because updating a field will erase any editing done to the field text.
    Cindy Meister, VSTO/Word MVP
  • 4. července 2009 10:33Cindy MeisterMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Karthik

    In that case, all you need to do is delete those headings and insert your own. The field result can be manipulated just like any other text in the document. What you do just isn't "permanent" (will be lost when the field updates).
    Cindy Meister, VSTO/Word MVP

Všechny reakce

  • 3. července 2009 10:56Cindy MeisterMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Karthik

    I don't have any code for this - I've never tried this particular exercise...

    What the person answering means is that you need to "walk" the Index entries (TOC was probably just a lapse of concentration) - probably paragraphs, but it will depend on the type of Index. Where you find a number as the first character of an entry, your code would delete that and any other extraneous characters (dashes, spaces, etc). Do that until the numbers stop.

    At the same time, also delete the "section heading" for each number (1, 2, 3, etc).

    And, of course, at the top insert the "section heading" you want to see.

    As the person notes, this code would have to be run again everytime the Index is updated. This is because updating a field will erase any editing done to the field text.
    Cindy Meister, VSTO/Word MVP
  • 3. července 2009 12:32Karthik.SK Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Cindy,


    Here i don't need to modify the entries. let the entries be starting  with numerics or extraneous characters, but i need to change all those numeric entries to be displayed under a common heading.


    Thx in advance
    Karthik


  • 4. července 2009 10:33Cindy MeisterMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Odpovědět
    Hi Karthik

    In that case, all you need to do is delete those headings and insert your own. The field result can be manipulated just like any other text in the document. What you do just isn't "permanent" (will be lost when the field updates).
    Cindy Meister, VSTO/Word MVP
  • 5. července 2009 5:55Karthik.SK Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Hi Cindy,

    Is there any macro or sample available to get the headings of the index?

    -karthik
  • 6. července 2009 8:32Cindy MeisterMVP, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    I know of none. In any case, it's going to depend on exactly how the Index is generated (the particular properties used).


    Cindy Meister, VSTO/Word MVP