none
How to cross reference text string with heading RRS feed

  • Question

  • On my current project, I need to build a cross reference containing a system requirement # to the section number where that id is located.   So for example there is a requirement to validate a certain input field.   That requirement has an id of SR12345 and it is located in the section titled Edit Input Fields.  Edit Input Fields has a Heading 2 style.   So the resulting cross reference table would look something like this.

    .Requirement#   Brief Description   Section Id

    SR12345           Edit Input Fields       5.2

    The Requirement # is the text string that will be entered usually at the end of a paragraph of text.  The Brief Description is the heading text and Section Id is the heading number generated by Word.  

    I'm assuming that this xref would probably require VBA code to generate the data.  Since others will be adding content into various sections of the document each iteration, there is a good chance that the heading numbers will change so I'm thinking of code that would provide the data that can be pasted into a table and manually formatted once a month.   did build a fairly sophisticated contract generator using bookmarks some years ago but can't figure out the best way to handle this challenge.   

     

    Wednesday, November 16, 2011 1:34 AM

Answers

  • Hi DJDoel,

    Since you have text like "Below are the methods involved.Ref SR859576, SR859578, SR859582, SR859587, SR859591" that suggests the SR#s could/should be part of the headings preceding the descriptive text for those methods. In that case, a simple TOC could be used to list them. The heading paragraph #s would precede the text, though, and the entries would end up looking like:

    2.6.4.1 SR859576 Default primary order of tasks
    2.6.4.2 SR859578 Default secondary order of tasks
    2.6.4.3 SR859580 From and To column data
    2.6.4.4 SR859582 Sort on From field
    2.6.4.5 SR859587 Secondary From sort order
    2.6.4.6 SR859591 Return to default order order

    The potential advantage is that a TOC can also give you the page #s if you format it to do so.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Monday, December 5, 2011 7:10 AM

All replies

  • Hi DJDoel,

    Since you're using Word's Heading scheme, you can simply insert a cross-reference to the relevant heading. If, as a result of subsequent edits, the heading # changes, the cross-reference will update to relect the change (provided someone doesn't 'move' the referenced heading by creating a new heading with the same name somewhere else in the document and deleting the old one). No 'updating' code would be required for such cross-referencing.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Wednesday, November 16, 2011 7:25 AM
  • I tried to use the cross-reference but it replaces each reference to the SRxxxxx with the heading name or number.  I need the SR number to remain in the text.  What I am looking for is an automated way to link the SR numbers to the section heading where that number appears.  THe SR#s and their short description are known in advance so I only need to figure out a way to get the heading number associated with each SR.  It could be done manually but would take a lot of time to verify the heading number of each one (we may have over 100 by end of the release)  at the end of each iteration.  

    Wednesday, November 16, 2011 9:27 PM
  • Hi DJDoel,

    The process I described was for maintaining the Brief Description and Section Id portions of your table.

    You say:
    "The Requirement # is the text string that will be entered usually at the end of a paragraph of text."
    If it's not part of the paragraph that contains the Brief Description heading, then where does it appear?


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Thursday, November 17, 2011 8:57 AM
  • Here is an example of a typical paragraph with a reference to an SR#.   The SR# are entered by the developers when they add content.

    2.6.4 Sorting

        Sorting functionality will be by the priority (ascending), timestamp (ascending) by default.  The user also has the option to Sort by the   From  column.  Below are the methods involved.  Ref SR859576, SR859578, SR859582, SR859587, SR859591

      

    What we need to provide in the document is an index to the SR# and the section in which it appears - the table looks something like this.  This table gives the client the ablity to easily audit the document to ensure that all SRs have been documented.

    SR #

    Brief Description of System Requirement

    DDS Element Reference

    SR859576

    Default primary order of tasks

    2.6.4

    SR859578

    Default secondary order of tasks

    2.6.4

    SR859580

    From and To column data

    2.6.5

    SR859582

    Sort on From field

    2.6.4

    SR859587

    Secondary From sort order

    2.6.4

    SR859591

    Return to default order order

    2.6.4

     

    Thursday, November 17, 2011 2:21 PM
  • Hi DJDoel,

    Since you have text like "Below are the methods involved.Ref SR859576, SR859578, SR859582, SR859587, SR859591" that suggests the SR#s could/should be part of the headings preceding the descriptive text for those methods. In that case, a simple TOC could be used to list them. The heading paragraph #s would precede the text, though, and the entries would end up looking like:

    2.6.4.1 SR859576 Default primary order of tasks
    2.6.4.2 SR859578 Default secondary order of tasks
    2.6.4.3 SR859580 From and To column data
    2.6.4.4 SR859582 Sort on From field
    2.6.4.5 SR859587 Secondary From sort order
    2.6.4.6 SR859591 Return to default order order

    The potential advantage is that a TOC can also give you the page #s if you format it to do so.


    Cheers
    Paul Edstein
    [MS MVP - Word]
    Monday, December 5, 2011 7:10 AM