locked
Word 2007 - Table of Contents RRS feed

  • Question

  • To make this clear, I will repeat the structure of what I have done, and what shows up, and then tell me if there is a specific way to solve it.

    I have Headers. Header 1 creates the words Article I and then every next Header 1 after each one is simply the next number, so will be Article II, Article III etc.

    Header 2 creates the paragrahps under an Article. So if this is Article I and I put a Header 2 under it, the automatic words are Section 1.1 and each one is simply the next number, so will be Section 1.2, Section 1.3 etc.

    When I create an Article I, it is located in the middle of the document, and at the end of the Article I, I click on shift+enter, and it creates a line break underneath the word Article I, and I type in the title for Article I called Article Title.

    When I create Section 1.1 under it, after the words Section 1.1, on the same line, I type in the title of the Section called Section Title, and then a period, then two spaces, and type in the paragraph of Section 1.1.

    I then highlight the words of the Section 1.1 title name called Section Title, click on alt+shift+o, and it opens up Mark Table of Contents Entry. The entry areas shows the section title name called Section Title, the table identifier is C and I make the level 2. And the TC field shows up as { TC "Section Title" \f C \1 "2"}.

    I then create and go to the Table of Contents, select it, click on alt+F9 and I adjust the TOC to {TOC \o "1-1" \h \z \u \f}, which is what I was told to do.

    And I update the full Table of Contents and it shows up as the following with the page numbers:

    ARTICLE I Article Title

    Section Title

    So the point is, the words Article I and Article Title, show up perfectly in the Table of Contents.

    But the words of Section 1.1, show the words Section Title, and not the begniing words from the header names Section 1.1.

    So I have now described everthing, so if anyone can tell me how to fix this in details so Section 1.1 shows up before the words Secition Title in the Table of Contents, I would truly appreciate it.

    Thank you very much as usual. I appreciate the online support!

    Sunday, April 7, 2013 1:22 AM

Answers

  •  You haven't created a dotx template nor used Linked Paragraph and Character. Please read through Shauna's website on numbering.

    I've sent you an amended dotx template doing what you asked which is the quickest way. As I said a template with numbering needs to be created and then used to File New (take a copy) to create your new working document based on the template and saved with a new name as a docx document.

    If you want to use TC fields do so but your original request has been resolved.

    Kind regards

    Janine

     

    • Proposed as answer by JanineC Tuesday, April 9, 2013 11:10 PM
    • Marked as answer by Just Karl Wednesday, October 16, 2013 3:59 PM
    Tuesday, April 9, 2013 11:10 PM

All replies

  • The forums on MSDN target programming questions; working with fields is an end-user issue and should be asked in the "Communities", where you'll find a lot more people who have experience in this area
      http://answers.microsoft.com/en-us/office/forum/word?tm=1365313287001

    Unfortunately, we can't move discussions from MSDN to the Communities so you'll need to ask there.

    But FWIW, if Article shows up the way you wish, then do Sections the same way. If you don't need a TC field for Section, then remove it (them). In the TOC field, set \o "1-2" to pick up both outline (heading) levels.

    You might also find information about what the various field switces do useful. In Insert/Text/Quick Parts/Field select TOC in the list on the left. Click on "Field codes", then "Options" and you can see a list of the various switches available and what they do.


    Cindy Meister, VSTO/Word MVP, my blog

    Sunday, April 7, 2013 5:50 AM
  • Thanks very much.  I did post it also there, but others had told me to post it here as well.

    And just to say, the Aricle area has the typed in title below it, but the Section area has the typed in title on the same line, so the Article line break process is not for the Section area.

    And the key hope was that I could just highlight the typed in title of the Section, create the TC and it works.  So I will look at those field switches, but if you know which one to add that automatically includes the words from the heading Section 1.1, I appreciate it.

    Sunday, April 7, 2013 2:45 PM
  • Posting here only makes sense if you're looking for a macro solution, but that would not be "automatic".

    Cindy Meister, VSTO/Word MVP, my blog

    Sunday, April 7, 2013 2:56 PM
  • The link contains an example of the numbering you are trying to achieve. You should be able to work it out!

    Article I shift return Heading for Article I

    Section 1.0     Section Title  This is the body text that follows.

    You need to use Linked Paragraph and Character styles to achieve this in your Multilevel Lists.

    Hope this makes it a little clearer.

    http://sdrv.ms/10x3OJ2

    Kind regards

    Janine

    Monday, April 8, 2013 4:10 AM
  • Thank you for your comment, but that link is not clear what and how to do it. 

    How should I learn what to do please?

    Monday, April 8, 2013 9:58 PM
  • If what you said is faster, please let me know.

    I just created another way to do it, where I do the TC, and before the title of that section that I highlighted and added to the TC, inside the TC I added a cross reference to the the Section 1.1.  And it shows up in the TOC.

    And if I change the sections by adding new paragraphs, if Section 1.1 becomes Section 1.2, it updgrades to the TCO as well.

    Let me know if there is a faster way to do it.

    Thanks.

    Monday, April 8, 2013 11:02 PM
  • Hi Imseadz

    If you could provide a copy of your Word document but remove any confidential text first please.

    If I can see how you do your auto numbering and the document layout it would be easier.

    My email is Janine@docxtools.com.au or you can upload to Skydrive Public folder and provide a link.

    Kind regards

    Janine

    Monday, April 8, 2013 11:13 PM
  • Imseadz here is a link to autonumbering by the infamous Shauna Kelly.

    http://www.shaunakelly.com/word/numbering/numbering20072010.html

    If you want to use autonumbering please follow the steps and practise setting up a List Style and then creating your Multilevel List numbering outline and attaching the style names (eg Heading 1) to List Level 1.

    US legal outline numbering is complex - so you are diving in at the deep end. As you will see Shauna has spent many hours explaining outline numbering and TOCs (table of contents) - it is the most comprehensive resource available that I am aware of.

    Meantime I will look at the document.

    Kind regards

    Janine

    Tuesday, April 9, 2013 1:01 AM
  • And in addition, my styles of the each header is from creating a mulit list where each level is linked to a a heading. So have already done that.

    So, again, in addition to simply doing a cross reference to the heading language, which would for example be Section 1.1, is there a faster way to create this TOC so it recognzes the heading language and the first few words I type in the paragraph as the title of that paragraph?

    Tuesday, April 9, 2013 4:13 AM
  •  You haven't created a dotx template nor used Linked Paragraph and Character. Please read through Shauna's website on numbering.

    I've sent you an amended dotx template doing what you asked which is the quickest way. As I said a template with numbering needs to be created and then used to File New (take a copy) to create your new working document based on the template and saved with a new name as a docx document.

    If you want to use TC fields do so but your original request has been resolved.

    Kind regards

    Janine

     

    • Proposed as answer by JanineC Tuesday, April 9, 2013 11:10 PM
    • Marked as answer by Just Karl Wednesday, October 16, 2013 3:59 PM
    Tuesday, April 9, 2013 11:10 PM
  • If you need to continue this discussion, please take it to the Communities post that Imseadz mentions already exists. This discussion is off-topic in the Developer forums and should be pursued in the correct venue. In the interests of completeness, please copy any useful content that can be considered an "Answer" to the problem to the thread on Communities.

    Thank you for your understanding :-)


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, April 10, 2013 9:10 AM
  • Thanks to all.

    I am told this area can solve or give the advice re macros.

    I do have a number of macros I use for Outlook 2007, so I know where to create it and how to create links to it etc.

    So the macro I would love to have would do the following:

    My Word 2007 Document has the headings that come from creating a mulitlist, and I link each level of the list to the appropriate heading.

    So when begin a document, I click on the heading, and then I type in the words.  So the example is that Heading 2 creates the original words from the Heading:  Section 1.1, and then after that is created, I type in the words after it.   Then I create the TC where I highlight the title words of Section 1.1 I had typed in, and those show up in the TC field.  Then I click on Insert, Cross Reference, make the Insert reference to "Paragraph number (full context), and then insert Section 1.1.   And as a result, in the TOC, the Section 1.1 and the title I added to the TC both show up.

    So, what would be the macro where if I am in a certain paragraph of the heading, I click on the macro that just does the insert of the cross reference to the heading words that come with heading.   So it automatically then does what I showed above and goes to the heading that I am in re the paragraph.

    That would be great.  Thanks very much.

    Wednesday, April 10, 2013 10:18 PM
  • Antoher way to expain this:

    Each Header has it's words that start with the Header.   So Heading I, is Article I.   Heading II is Section 1.1   That's what shows up when I click on the Header to make the paragraph.   So all I need is the macro that automatically creates the cross reference to the Paragarph number of Header relatative to the paragraph I am in.   So if it is in Section 1.1, I can create a cross reference by going to Input, Cross Reference, and in the Cross Reference Box, the  the Reference Type is Numbered Type, and the Insert Reference To is Paragraph (full context), and then I click on the numbereed item in the Cross Reference box at number of the paragraph I am in.

    So is there a macro that can do this when I am in the paragraph relative to the cross reference number I want, or is there a macro that can do this other than picking the numbered item, so it just starts up everthing in the Cross Reference box other than picking the numbered item, and then I can pick it from the Cross Reference Box that has been started up per the maco?

    Thursday, April 11, 2013 4:25 PM
  • One more point that maybe takes care of it if someone knows how to create the macro or the shortcut.

    So just focuses on Heading 2 paragraph that looks like this:

    Section 1.1 Title. words words words.

    If this is already in place through out the document in each section, here is what I also learned to do per each one, and if there is a way to create the macro that does this or a shortcut that does this, that would also be fine.

    I put the mouse before the the words: "words words words". Then from the keyboard I do the following:

    Ctrl+Alt+Enter Then I click on Enter again. Then I click on Ctrl+Shift+n

    And doing to forgoing, it changes the style just to the words of that paragraph and shows just Section 1.1 Title in the TOC.

    So is there a way to create a macro or a shortcut, that does each of those in the same order, so all I have to do at each heading paragraph, click on one click or tab, and its done.

    Thanks again very much.


    • Edited by lmseaz Saturday, April 13, 2013 4:24 PM
    Saturday, April 13, 2013 4:23 PM
  • I found an easy way to do what I need to do, and just curious if you know how to fix a macro that bascially runs the keyboard clicks I use in certain order of doing them.

    Here is the info:

    So just focuses on Heading 2 paragraph that looks like this:

    Section 1.1 Title. words words words.

    If this is already in place through out the document in each section, here is what I also learned to do per each one.


    I put the mouse before the the words: "words words words". Then from the keyboard I do the following:

    Ctrl+Alt+Enter Then I click on Enter again. Then I click on Ctrl+Shift+n

    And doing to forgoing, it changes the style just to the words of that paragraph and shows just Section 1.1 Title in the TOC.


    I went to developer, record macro, and recorded the following process:

    Ctrl+Alt+Enter Then I click on Enter again. Then I click on Ctrl+Shift+n.

    As it does what it does as I mentioned above, but when I run the macro, the words "words words words" are pushed below the Section 1.1 Title. Not staying where typed.

    So when I do it, manually, it does not move the words below but the macro does that. So here is the macro that is formed and is there way to simply adjust the macro so it does not move the words below the title?

    Sub Macro2()
    '
    Selection.InsertStyleSeparator
    Selection.TypeParagraph
    Selection.Range.Style = ActiveDocument.Styles(wdStyleNormal)
    End Sub

    Saturday, April 13, 2013 6:06 PM
  • Pam Caswell solved it at another forum.
    Sunday, April 14, 2013 1:10 AM